Bug 25406 - [ARM] pcrel relocations referencing STB_GLOBAL symbols are resolved at assembly time
Summary: [ARM] pcrel relocations referencing STB_GLOBAL symbols are resolved at assemb...
Status: UNCONFIRMED
Alias: None
Product: binutils
Classification: Unclassified
Component: gas (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-01-17 04:17 UTC by Fangrui Song
Modified: 2020-01-17 04:17 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Fangrui Song 2020-01-17 04:17:44 UTC
% cat pcrel-global.s
.syntax unified

.globl foo
foo:
ldrd r0, r1, foo @ arm_pcrel_10_unscaled
vldr d0, foo     @ arm_pcrel_10
adr r2, foo      @ arm_adr_pcrel_12
ldr r0, foo      @ arm_ldst_pcrel_12

.thumb
.thumb_func

.globl bar
bar:
adr r0, bar      @ thumb_adr_pcrel_10
adr.w r0, bar    @ t2_adr_pcrel_12
ldr.w pc, bar    @ t2_ldst_pcrel_12

% arm-linux-gnueabi-as -mfpu=vfp pcrel-global.s -o /tmp/c/a.o
% readelf -r /tmp/c/a.o

There are no relocations in this file.


If the definitions of foo and bar are deleted, each instruction can issue an error.



STB_GLOBAL STV_DEFAULT symbols can be preemptible (if in a shared object). Should relocations be emitted? On many other architectures, relocations will be emitted.