Summary: | R_ARM_COPY relocation generated with -znocopyreloc | ||
---|---|---|---|
Product: | binutils | Reporter: | David Crawshaw <david> |
Component: | ld | Assignee: | Not yet assigned to anyone <unassigned> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | matz, maxim.kuvyrkov, nickc, rguenth |
Priority: | P2 | ||
Version: | 2.25 | ||
Target Milestone: | --- | ||
Host: | Target: | arm, aarch64 | |
Build: | Last reconfirmed: | ||
Attachments: |
Proposed patch
Proposed patch |
Description
David Crawshaw
2016-04-17 15:07:00 UTC
Created attachment 9208 [details]
Proposed patch
Hi David,
Please try out this patch.
Cheers
Nick
Hi David, Any feedback on Nick's patch? It's reported that the same issue exists for aarch64 (and Nicks patch is meanwhile on master but only addresses arm). Created attachment 12792 [details]
Proposed patch
FYI - here is a proposed, but completely untested, patch for the AArch64...
So with current master binutils, without additional changes I don't see copy relocs on aarch64 with the (adjusted for data size) example: % cat data-ref.s .globl _start .p2align 4 _start: ret .data .globl data_object # .section .rodata,"a",@progbits object_reference: .quad data_object .size object_reference,8 % cat libdata.s .data .globl data_object .type data_object, %object .size data_object, 8 data_object: .quad 123 % ./gas/as-new -o data-ref.o data-ref.s % ./gas/as-new -o libdata.o libdata.s % ./ld/ld-new -shared -o libdata.so libdata.o % ./ld/ld-new -znocopyreloc -o data-ref data-ref.o libdata.so % readelf -rW data-ref Relocation section '.rela.dyn' at offset 0x230 contains 1 entry: Offset Info Type Symbol's Value Symbol's Name + Addend 0000000000411000 0000000100000101 R_AARCH64_ABS64 0000000000000000 data_object + 0 This doesn't change when the '.section rodata' directive is uncommented, i.e. when the reference comes from a read-only section. Still no copy-reloc. (Without the -znocopyreloc linker option we do generate a copy reloc, but that's expected). So, right now I don't see anything in need for fixing. This all was somewhat related to a go problem: https://github.com/golang/go/issues/22040 . If that one still exists then it's different from _this_ problem report here. If there's new info or a reproducer that still shows a problem, please reopen. (And just FWIW: aarch64 binutils 2.36 and 2.37 don't have the problem either). |