[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug gold/28234] New: [AArch64] gold: ADR/ADD relocations on wrong instr
From: |
fads93 at gmail dot com |
Subject: |
[Bug gold/28234] New: [AArch64] gold: ADR/ADD relocations on wrong instructions |
Date: |
Mon, 16 Aug 2021 08:06:53 +0000 |
https://sourceware.org/bugzilla/show_bug.cgi?id=28234
Bug ID: 28234
Summary: [AArch64] gold: ADR/ADD relocations on wrong
instructions
Product: binutils
Version: unspecified
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: gold
Assignee: ccoutant at gmail dot com
Reporter: fads93 at gmail dot com
CC: ian at airs dot com
Target Milestone: ---
The application is compiled with `gcc -Wl,-q -fuse_ld=gold -O2 test_2.c -o
test`.
Source:
https://github.com/ijinma/test_for_bolt/blob/master/bolt_error_2/test_2.c
objdump -dr, without -fuse-ld=gold:
0000000000000610 <main>:
610: 5290d3e2 mov w2, #0x869f // #34463
614: a9bd7bfd stp x29, x30, [sp, #-48]!
618: d284e203 mov x3, #0x2710 // #10000
61c: 72a00022 movk w2, #0x1, lsl #16
620: 910003fd mov x29, sp
624: d503201f nop
628: 940000b0 bl 8e8 <foo_b>
628: R_AARCH64_CALL26 foo_b
62c: b9001bff str wzr, [sp, #24]
630: b9401be0 ldr w0, [sp, #24]
634: 6b02001f cmp w0, w2
638: 5400010c b.gt 658 <main+0x48>
63c: d503201f nop
With -fuse-ld=gold:
00000000000005e0 <main>:
5e0: 5290d3e2 mov w2, #0x869f // #34463
5e4: a9bd7bfd stp x29, x30, [sp, #-48]!
5e8: d284e203 mov x3, #0x2710 // #10000
5ec: 72a00022 movk w2, #0x1, lsl #16
5ec: R_AARCH64_ADR_PREL_PG_HI21 __init_array_end
5f0: 910003fd mov x29, sp
5f0: R_AARCH64_ADD_ABS_LO12_NC __init_array_end
5f4: d503201f nop
5f8: 940000b0 bl 8b8 <foo_b>
5f8: R_AARCH64_CALL26 foo_b
5f8: R_AARCH64_ADR_PREL_PG_HI21 __init_array_start
5fc: b9001bff str wzr, [sp, #24]
5fc: R_AARCH64_ADD_ABS_LO12_NC __init_array_start
These relocations are incorrect:
5ec: 72a00022 movk w2, #0x1, lsl #16
5ec: R_AARCH64_ADR_PREL_PG_HI21 __init_array_end
5f0: 910003fd mov x29, sp
5f0: R_AARCH64_ADD_ABS_LO12_NC __init_array_end
Versions:
Ubuntu 20.04
gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0
GNU gold (GNU Binutils for Ubuntu 2.34) 1.16
For more details see https://github.com/facebookincubator/BOLT/issues/157.
--
You are receiving this mail because:
You are on the CC list for the bug.
- [Bug gold/28234] New: [AArch64] gold: ADR/ADD relocations on wrong instructions,
fads93 at gmail dot com <=