Skip to content

[arm] After 2bfee35cb86, "unsupported relocation on symbol" #44274

@DimitryAndric

Description

@DimitryAndric
Bugzilla Link 44929
Resolution FIXED
Resolved on May 06, 2020 11:16
Version 10.0
OS Windows 2000
Blocks #43900
CC @emaste,@zmodem,@MaskRay,@nickdesaulniers,@smithp35

Extended Description

After 2bfee35 ("[MC][ELF] Emit a relocation if target is defined in the same section and is non-local"), the following assembly for arm no longer compiles:

clang -target armv6-gnueabihf -c adr-reloc.s

adr r0, foo
.global foo
foo:

Before:

$ clang-llvmorg-10-init-17163-g241f330d6ba -target armv6-gnueabihf-freebsd13.0 -c adr-reloc.s

$ llvm-objdump -d adr-reloc.o

adr-reloc.o: file format ELF32-arm-little

Disassembly of section .text:

00000000 $a.0:
0: 04 00 4f e2 sub r0, pc, #​4

After:

$ clang-llvmorg-10-init-17164-g2bfee35cb86 -target armv6-gnueabihf -c adr-reloc.s
adr-reloc.s:2:1: error: unsupported relocation on symbol
adr r0, foo
^

This is a regression.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzilla

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions