ld: Simple Linker Script Example

Ian Lance Taylor ian@wasabisystems.com
Fri Nov 7 02:02:00 GMT 2003
Barry Rountree <rountree@uga.edu> writes:

> I'm puzzling my way through the ld documentation and I think I'm in need of 
> the "hello, world!" of linker scripts -- the minimal linker script that will 
> link two C files together into an executable.

Well, what kind of executable?  One that runs on a simple embedded
system, or one that runs on GNU/Linux?  For GNU/Linux, is the
executable statically or dynamically linked?

If you want a dynamically linked executable to work on GNU/Linux, you
need a moderately complex linker script.  That's a lot of the
complexity in the default linker script.

The same applies to Solaris, or indeed to any ELF system using dynamic
linking.

Ian



More information about the Binutils mailing list