This is the mail archive of the crossgcc@sources.redhat.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Build a short executable


"Pierre Saucourt-Harmel (r54698)" wrote:
[ .... ]
The "objdump -p" gave me the following "program headers" :
Program Header:
    LOAD off    0x00008000 vaddr 0x00000000 paddr 0x00000000 align 2**15
         filesz 0x00000060 memsz 0x00000060 flags r-x
    LOAD off    0x00010000 vaddr 0x00100000 paddr 0x00100000 align 2**15
         filesz 0x00000884 memsz 0x00000a08 flags rw-
    LOAD off    0x00018000 vaddr 0x07800000 paddr 0x07800000 align 2**15
         filesz 0x00002c14 memsz 0x00002c14 flags r-x
private flags = 0: [interworking not enabled] [APCS-32] [floats passed in integer registers] [absolute position]

Does any know if I can put all my sections in the same program header ? How can I start this program header to the minimal value ?
 

I found how to avoid the page-alignment, reducing the LOAD offset of each program header to the minimum. The --nmagic (the -n option does not seem to work) of the linker turns off the page-alignment. The ld.document about this option says:
-------------clip---------------------------------
`-n'
`--nmagic'
     Turn off page alignment of sections, and mark the output as
     `NMAGIC' if possible.
-------------clip---------------------------------

And now I obtain:

Program Header:
    LOAD off    0x00000094 vaddr 0x00000000 paddr 0x00000000 align 2**2
         filesz 0x00000060 memsz 0x00000060 flags r-x
    LOAD off    0x000000f4 vaddr 0x00100000 paddr 0x00100000 align 2**2
         filesz 0x00000884 memsz 0x00000a08 flags rw-
    LOAD off    0x00000978 vaddr 0x07800000 paddr 0x07800000 align 2**2
         filesz 0x00002c14 memsz 0x00002c14 flags r-x
private flags = 0: [interworking not enabled] [APCS-32] [floats passed in integer registers] [absolute position]

And my executable file contains now 14288 bytes against 110168 bytes (stripping all symbols for both generations) !!

Pierre.
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]