Need help on OVERLAY command in linker script...

Ian Lance Taylor ian@wasabisystems.com
Wed Jun 30 17:07:00 GMT 2004


Tao Zhang <zhangtao@cc.gatech.edu> writes:

> > Does it help to link with the -n or -N options?
> >
> 
> Your suggestion helps. I found my linker will try to align the sections at
> a 2^7 boundary in the program binary, though the memory alignment of the
> sections is 2^6. So that means maybe the load address of a section is
> 0x1040, but in the program binary, the offset of it is 0x1080. Using -n
> will prevent the alignment in binary. But according to the manual, -n
> turns off page alignment of sections, I don't know what "page" it is
> referring to. A memory page? It is certainly not 2^7 in my RH8 X86 system.

Each linker target has a page size which affects the linker script.
On x86 GNU/Linux I believe this page size is 0x1000.

The -n option really just changes the linker script.  Use --verbose to
the new linker script.

Ian



More information about the Binutils mailing list