From 8dfd77b47fa08ffa8f176843c90a19a604243e87 Mon Sep 17 00:00:00 2001 From: Peter Collingbourne Date: Sat, 15 Dec 2018 00:20:17 +0000 Subject: ELF: Handle R_ARM_V4BX correctly in PIC output files. Previously we considered R_ARM_V4BX to be an absolute relocation, which meant that we rejected it in read-only sections in PIC output files. Instead, treat it as a hint relocation so that relocation processing ignores it entirely. Also fix a problem with the test case where it was never being run because it has a .yaml extension and we don't run tests with that extension. Differential Revision: https://reviews.llvm.org/D55728 --- lld/test/ELF/arm-v4bx.test | 40 ++++++++++++++++++++++++++++++++++++++++ lld/test/ELF/v4bx.yaml | 38 -------------------------------------- 2 files changed, 40 insertions(+), 38 deletions(-) create mode 100644 lld/test/ELF/arm-v4bx.test delete mode 100644 lld/test/ELF/v4bx.yaml (limited to 'lld/test') diff --git a/lld/test/ELF/arm-v4bx.test b/lld/test/ELF/arm-v4bx.test new file mode 100644 index 00000000000..1b39a431417 --- /dev/null +++ b/lld/test/ELF/arm-v4bx.test @@ -0,0 +1,40 @@ +# REQUIRES: arm +# RUN: yaml2obj %s -o %t.o +# RUN: ld.lld %t.o -o %t +# RUN: llvm-readelf -sections %t | FileCheck %s +# RUN: ld.lld -shared %t.o -o %t +# RUN: llvm-readelf -sections %t | FileCheck %s + +# CHECK: .text + +--- !ELF +FileHeader: + Class: ELFCLASS32 + Data: ELFDATA2LSB + Type: ET_REL + Machine: EM_ARM + Flags: [ EF_ARM_EABI_VER5 ] +Sections: + - Name: .text + Type: SHT_PROGBITS + Flags: [ SHF_ALLOC, SHF_EXECINSTR ] + AddressAlign: 0x0000000000000004 + Content: 1EFF2F01 + - Name: .rel.text + Type: SHT_REL + Link: .symtab + AddressAlign: 0x0000000000000004 + Info: .text + Relocations: + - Offset: 0x0000000000000000 + Symbol: '' + Type: R_ARM_V4BX +Symbols: + Global: + - Name: _start + Section: .text + Local: + - Name: .text + Type: STT_SECTION + Section: .text +DynamicSymbols: diff --git a/lld/test/ELF/v4bx.yaml b/lld/test/ELF/v4bx.yaml deleted file mode 100644 index 8dd619faa57..00000000000 --- a/lld/test/ELF/v4bx.yaml +++ /dev/null @@ -1,38 +0,0 @@ -# REQUIRES: arm -# RUN: yaml2obj %s -o %t.o -# RUN: ld.lld %t.o -o %t -# RUN: llvm-readelf -sections %t | FileCheck %s - -# CHECK: .text - ---- !ELF -FileHeader: - Class: ELFCLASS32 - Data: ELFDATA2LSB - Type: ET_REL - Machine: EM_ARM - Flags: [ EF_ARM_EABI_VER5 ] -Sections: - - Name: .text - Type: SHT_PROGBITS - Flags: [ SHF_ALLOC, SHF_EXECINSTR ] - AddressAlign: 0x0000000000000004 - Content: 1EFF2F01 - - Name: .rel.text - Type: SHT_REL - Link: .symtab - AddressAlign: 0x0000000000000004 - Info: .text - Relocations: - - Offset: 0x0000000000000000 - Symbol: '' - Type: R_ARM_V4BX -Symbols: - Global: - - Name: _start - Section: .text - Local: - - Name: .text - Type: STT_SECTION - Section: .text -DynamicSymbols: -- cgit v1.2.3