portable method to add a new output section?

Gary Funck gary@intrepid.com
Fri Feb 1 17:28:00 GMT 2008


On 02/01/08 10:44:35, Nick Clifton wrote:
>
> Have you tried just adding this partial script to the linker command line ? 
>  If the linker sees a file specified on the command line in a format that 
> it does not recognise it assumes that it is a linker script and it uses 
> this script to augment the current linker script.

Nick, thanks.  I was going to try that, but the manual,
http://www.gnu.org/software/binutils/manual/ld-2.9.1/html_mono/ld.html#SEC17
says "You may use at most one SECTIONS command in a script file ...".

I just tried adding a text file to the link line with the
following contents:

SECTIONS {
  .upc_shared 0x10000 (NOLOAD) : { *(upc_shared) }
  }

And it seemed to work as expected, still procesing the default
linker spec. as well.   The only small glitch is that this special
section came first in the file, where I was hoping it might
be placed just after the .data section (for no particular
technical reason) which is where the other named sections appear.



More information about the Binutils mailing list