This is the mail archive of the binutils@sourceware.cygnus.com mailing list for the binutils project.


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

Re: binutils: elf sections - copying from ROM to RAM.


   Date: Mon, 28 Feb 2000 17:53:03 +1100
   From: Brendan J Simon <Brendan.Simon@ctam.com.au>

   The powerpc linker script (ads script taken from newlib-1.8.1) has
   _many_ sections.  Is there some documentation describing the meaning and
   use of all these sections (.interp, .hash, .dynsyn, .dynstr, .rela.text,
   .rela.data, .plt, etc) ?

The PowerPC ELF ABI supplement.  All the sections you mention are used
for dynamic linking.  For most embedded systems, they are useless.

   My linker script calculates of offset between ROM and RAM and uses this
   for the address AT uses.
   eg.
   RomStart = 0xffe01000;
   RamStart = 0x00001000;
   loadOffset = RomStart - RamStart;
   .text : AT(. + loadOffset) { ... }

   I now get link error messages saying "Not enough room for program
   headers (allocated 3, need 14)".
   Where are the program headers supposed to live ?

At the start of the program.  You can avoid this problem by omitting
SIZEOF_HEADERS.  There is no reason to use it on an embedded system.

14 program segments is a lot.  Take a look at the objdump -h -p output
to make sure your sections are winding up where you want them to be.

   Is this a good way to copy initialised data from ROM to RAM ?  Any
   suggestions ?

Looks more or less right to me.

   The DiabData script uses a GROUP statement which encapsulates multiple
   SECTION statements.
   Is there something equivalent for gcc/ld ?

No.  You can use memory regions, but you have to specify them for each
output section.

Ian

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