how to add segment at address 0?

Vladimir Kondratiev vladimir.kondratiev@intel.com
Tue Feb 4 17:28:00 GMT 2003


Hello,

I need to allocate some data at address 0. Otherwise, it is ordinal "C" 
program. All I need is one section starting at address 0.

I tried to tweak LD script to add one more segment. Here I faced with 
problem:

I printed "default" LD script using "--verbose" flag and started to 
modify it. But, since I need to add segment, I need to use PHDRS. LD 
"default" script have no PHDRS directive. On myself, I did not succeeded 
  to write proper PHDRS and set up sections to use proper segments.

How should I do it? Let's say, I need to write "C" program where section 
".zero_based" will start at address 0.

Output format - ELF for Linux on i386.

Regards, Vladimir.

mailto: vladimir.kondratiev @ intel.com



More information about the Binutils mailing list