Hi,
I have the following linker script:
TOTO = 1024;
TOTO += 1024;
SECTIONS
{
.rodata TOTO :
{
__toto_symbol_abs = ABSOLUTE(TOTO);
*(.rodata)
*(.rodata.*)
}
}
When I link this example with the latest ld, the section ".rodata" is
placed at 1024, whereas I would have expected 2048. __toto_symbol_abs
gets the value 2048.
With ld 2.22.52 .rodata is placed at 2048. I believe this commit by Alan
Modra changed ld's behaviour: 4194268f43623a5f893b9a92b0456d3cb43ab915.
My understanding of the patch is that it delays the evaluation of
self-referential expressions until section sizing has been completed. We
depended on the previous behaviour for correct placement of output
sections (mostly calculating alignment constraints).
Is what I observe expected behaviour? If so is there any way to achieve
what I want apart from using static single assignment? And why the change?
I used the following command:
ld -T test.ld main.o -o main
where main.o is simply:
int main(void){return 0;}
compiled with:
gcc -c main.c
I'd be very grateful for any information on this issue.
Best Regards,
Samuel Jones
Kalray SA - www.kalray.eu
_______________________________________________
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils