flat assembler
Message board for the users of flat assembler.

Index > Linux > ld crash...

Author
Thread Post new topic Reply to topic
DustWolf



Joined: 26 Jan 2006
Posts: 373
Location: Ljubljana, Slovenia
DustWolf 22 Apr 2008, 21:35
Hi,

I've been trying to brush up on my Linux FASM since moving to x86_64 with my workstation PC (Ubuntu).

I have looked into various howtos and have come up with this simple test program:
Code:
format elf executable
entry main

main:
        mov eax,1
        mov ebx,0
        int 80h    

And the Makefile to go with it:
Code:
#Makefile for helloWorld

all:
        fasm helloWorld.asm helloWorld.o
        ld -m elf_i386 -o helloWorld helloWorld.o    

However "make" ends in disaster:
Quote:
$ make
fasm helloWorld.asm helloWorld.o
flat assembler version 1.67.26 (16384 kilobytes memory)
2 passes, 96 bytes.
ld -m elf_i386 -o helloWorld helloWorld.o
ld: BFD (GNU Binutils for Ubuntu) 2.18 internal error, aborting at ../../bfd/bfd.c line 1607 in bfd_emul_get_maxpagesize

ld: Please report this bug.

make: *** [all] Error 1

Is this an actual bug, or is there some horribly wrong with my simple code?
Post 22 Apr 2008, 21:35
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20303
Location: In your JS exploiting you and your system
revolution 23 Apr 2008, 02:35
If you are running x86_64 then I would imagine you need 64bit code in your elf exe.
Code:
format ELF64 executable    
And why are you trying to link an executable file? Did you want an object file?
Code:
format ELF64    
Post 23 Apr 2008, 02:35
View user's profile Send private message Visit poster's website Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 23 Apr 2008, 07:47
Still, it is bug of ld, and you should report it.
Post 23 Apr 2008, 07:47
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
DustWolf



Joined: 26 Jan 2006
Posts: 373
Location: Ljubljana, Slovenia
DustWolf 23 Apr 2008, 17:17
revolution wrote:
And why are you trying to link an executable file? Did you want an object file?


Good point.

It would seem I was working on improper formats before which produced .o files, then assumed FASM always produces .o files.

Thanks. Smile
Post 23 Apr 2008, 17:17
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.