Steps to reproduce: $ cat > test.s << EOF .globl _start, foo, bar .section ".text.start", "ax" _start: bl foo .space 0x7000000 .section ".text.bar", "ax" bar: .space 0x1000000 .size bar, .-bar .section ".text.foo", "ax" foo: b _start EOF $ aarch64-linux-gnu-as test.s -o test.o $ ./gold-master test.o -o test.out $ nm -S test.out | grep "foo\|bar" 00000000074000c4 0000000001000000 T bar 00000000084000b4 T foo As you can see, the symbol 'foo' lays inside the content of 'bar'. If you use something like "objdump -d test.out" you will see that the content of the input section ".text.foo" is written on top of the section ".text.bar", so that it becomes crippled.
Created attachment 10018 [details] The fix for the issue Here is the fix for the issue.
Comment on attachment 10018 [details] The fix for the issue gold/ChangeLog * aarch64.cc (AArch64_relobj::convert_input_section_to_relaxed_section): Set the section offset to -1ULL. (Target_aarch64::relocate_section): Adjust the view in case of a relaxed input section. * testsuite/Makefile.am (pr21430): New test. * testsuite/Makefile.in: Regenerate * testsuite/pr21430.s: New test source file. * testsuite/pr21430.sh: New test script.
The master branch has been updated by Cary Coutant <ccoutant@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=6bf56e7482e220ff98655b5285736a37dd602c17 commit 6bf56e7482e220ff98655b5285736a37dd602c17 Author: Igor Kudrin <ikudrin@accesssoftek.com> Date: Fri May 12 15:24:32 2017 -0700 Fix misplacement of a relaxed section on AArch64. gold/ChangeLog PR gold/21430 * aarch64.cc (AArch64_relobj::convert_input_section_to_relaxed_section): Set the section offset to -1ULL. (Target_aarch64::relocate_section): Adjust the view in case of a relaxed input section. * testsuite/Makefile.am (pr21430): New test. * testsuite/Makefile.in: Regenerate * testsuite/pr21430.s: New test source file. * testsuite/pr21430.sh: New test script.
Fixed on trunk.