Do find out where in memory a certain variable is located I wished to create a new section next to .data and then use PROVIDE. The first step was to obtain the current linker script with ld --verbose
and then use it to link with -T amd64.ld
(amd64.ld is the file to which I saved the output of ld --vebose) the expectation being that I would get the same final ELF as when no linker script argument (-T) was given. However build fails with /usr/bin/ld: internal error ../../ld/ldlang.c 4986
Using gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0 and GNU ld (GNU Binutils for Ubuntu) 2.30
Anyone knows how to link with the default linker script?
The root cause was that -T was given twice, i.e. -Tamd64.ld -Tamd64.ld