On Mon, Jun 26, 2023 at 8:40 AM Nick Clifton <ni...@redhat.com> wrote: > > Hi Andrew, > > > Apologies for the generic subject, I don't totally understand the > > nature of the bug. > > No worries. You have the problem narrowed down to a single commit, > which definitely helps. > > > I have a basic linker script that stopped working after upgrading to > > binutils 2.40. I did a git bisect on the repository and it seems that > > the breakage starts with commit > > b1eecf6f66a4a642f4cb35688213e6c1c1ffdc79. > > Please could you file a bug report for this problem here: > > https://sourceware.org/bugzilla/enter_bug.cgi?product=binutils > > Having a bug report like this really helps us to track the bug > and ensure that it can be reviewed in the future, should it ever > come back.
Done, thanks! https://sourceware.org/bugzilla/show_bug.cgi?id=30590 > > > > $ ${LD} -o out.bin -T linker.ld lib1.a lib2.a > > You have now shown how lib1.a and lib2.a are created. I assumed > that you did: > > $ ar cr lib1.a test1.o test2.o > $ ar cr lib2.a test3.o Yes, forgot that part > > > > $ objdump -x out.bin | grep func > > c000001e g F .text 0000000a func3 > > c000000f g F .text 0000000f func1 > > c0000000 g F .text 0000000f func2 > > > > you see that func1 and func2 are in .text rather than .init-text where > > they should be. > > Yes, this is a bug. Not sure of the exact cause, but maybe the > new code in commit b1eecf6f66a4a642 in scanning the sections in > reverse order rather than forward order. > > Cheers > Nick > >