This is the mail archive of the mailing list for the binutils project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] PR gold/21430 Fix misplacement of a relaxed section on AArch64


When linking a large executable file for AArch64, gold might put a relaxed
section to a wrong position.

Here is a simplified reproducer:

$ cat > test.s << EOF
.globl _start, foo, bar

.section ".text.start", "ax"
    bl foo
    .space 0x7000000

.section "", "ax"
    .space 0x1000000
    .size bar, .-bar

.section "", "ax"
    b _start
$ 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 address for 'foo' lays inside 'bar', and so does
the content of its section.

See also

Best regards,
Igor Kudrin


	Set the section offset to -1ULL.
	(Target_aarch64::relocate_section): Adjust the view in case
	of a relaxed input section.
	* testsuite/ (pr21430): New test.
	* testsuite/ Regenerate
	* testsuite/pr21430.s: New test source file.
	* testsuite/ New test script.

Attachment: gold-pr21430-misplacing-relaxed-section-aarch64.patch.txt
Description: gold-pr21430-misplacing-relaxed-section-aarch64.patch.txt

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]