Regarding linker code generation

Nick Clifton nickc@redhat.com
Mon Aug 6 15:28:00 GMT 2007


Hi Verma,

> I am using gnu arm tool chain 4.1.1.

Which version of the linker is used with this toolchain ?  If it is a version 
earlier than 2.17 then it would be worth your while downloading the current 
binutils sources and building your own linker.


> I mean that when I build any shared object this toolchain is building only
> one segment as below
>  Program Header[0]:
>      p_vaddr:      0           p_flags:    [ PF_X PF_W PF_R ]
>      p_paddr:      0           p_type:     [ PT_LOAD ]
>      p_filesz:     0x2bc1f     p_memsz:    0x2d6c8
>      p_offset:     0           p_align:    0x8000
> 
> I know this header is needed ,but as per my knowledge this would make two
> segment of p_type:PT_LOAD type.
> mean two header values Program Header[0]: and  Program Header[1]: of
> p_type:PT_LOAD, one for data segment and one for text segment.
> why this tool chain only generate one segment . is there any thing wrong in
> tool chain.

Two segments are not essential.  One segment is sufficient, although possibly 
less efficient.  ie it is not required that data sections are placed in a 
read-only segment.  It is probably better to do so, but it is not required.

Cheers
   Nick




More information about the Binutils mailing list