Compiling ld, nm, objdump

Brian Bruinewoud brian@darknova.com
Sat May 5 01:45:00 GMT 2007


Hi,

I used to do OS dev on Windows using DJGPP and Nasm. Now I'm trying  
to do the same on OS X. The nasm and gcc that comes with OS X seem  
quite happy with the source code (so far) and produce object files.  
The OS X version of ld, however, is not the gnu one and as I have a  
linker script for ld, I need to get a version of ld working on OS X.

I've managed to compile a version of ld that accepts the nasm output  
(coff) but I can't get it to recognize the gcc object files (mach-o).  
Could some one enlighten me as to how to configure the binutils so  
that I can link nasm's coff and gcc's mach-o files? I need this for  
read only as the linker script produces a 'flat binary' and doesn't  
need bfd support for this.

Having nm and objdump would be nice, too, but ld is a show-stopper.

The config seems to support macho but I've never had much experience  
compiling gnu projects so I'm not sure how to go about configuring them.

I've tried:

./configure --enable-targets=all

but this had lots of errors in compilation which I think I fixed. The  
result was that the nasm file was considered to be 'ambiguous' and  
using the -b option to specify the input file type didn't fix the  
problem. I reasoned that the ambiguity might be due to targets=all so  
I tried various combinations (which I've lost evidence of) but I've  
only been able to get ld to recognise the coff but never both.

I just want some way of compiling ld so that it can read coff and macho.

Thanks,
Brian.



More information about the Binutils mailing list