This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: link script question - adding sections at specific addresses
- To: Becky Gill <bgill at ibmoto dot com>
- Subject: Re: link script question - adding sections at specific addresses
- From: Alan Modra <alan at linuxcare dot com dot au>
- Date: Fri, 4 Aug 2000 11:07:42 +1000 (EST)
- cc: binutils at sourceware dot cygnus dot com
On Thu, 3 Aug 2000, Becky Gill wrote:
> 1) Can someone explain how to add another text section to an elf32 ppc linux
> executable at a specific address? I need to add a new section of code that is
> located several pages away from the rest of an application's text and data.
> I've done a lot of playing around with the default elf32ppclinux.x script, but
> I keep getting the "not enough room for program headers" message, depending on
> where I put it.
As a first step, try replacing SIZEOF_HEADERS in your script with a fixed
constant. Choose a value somewhat larger than the current header size -
you seem to have already discovered what this is :-)
If this still gives linker errors, you will need to set up your own
program headers. Have a look at "Node: PHDRS" in the ld info
documentation. "readelf -l" will let you look at existing file headers.
Alan Modra
--
Linuxcare. Support for the Revolution.