Question about ld script file behaviour

Alan Modra amodra@gmail.com
Fri Sep 17 11:38:00 GMT 2010


On Fri, Sep 17, 2010 at 11:59:18AM +0100, Matthew Gretton-Dann wrote:
> The following patch causes the ld-arm/script-type test to fail (target
> any arm*-*-*):
>     http://sourceware.org/ml/binutils/2010-08/msg00169.html
> 
> The test case defines some symbols in an object and then in a linker
> script causes other symbols to be defined based upon those symbols:
> 
> SECTIONS {
>   foo_a = bar_a;
>   foo_t = bar_t;
>   foo_o = bar_o;
>   .text : { *(.text) }
>   .ARM.attribues 0 : { *(.ARM.attributes) }
> }
[snip]
> Following the above change foo_a, foo_t, and foo_o are now absolute
[snip]

Yes, that was a deliberate change, and the new values look correct to
me.  Assignments like the above will keep the original section if you
put them inside one of the output section statements.  eg.

SECTIONS {
  .text : {
    foo_a = bar_a;
    foo_t = bar_t;
    foo_o = bar_o;
    *(.text)
   }
  .ARM.attribues 0 : { *(.ARM.attributes) }
}

-- 
Alan Modra
Australia Development Lab, IBM



More information about the Binutils mailing list