diff options
-rw-r--r-- | lld/test/ELF/Inputs/dtrace-r.o | bin | 624 -> 0 bytes | |||
-rw-r--r-- | lld/test/ELF/dtrace-r.test | 8 | ||||
-rw-r--r-- | lld/test/ELF/icf10.s | 17 | ||||
-rw-r--r-- | lld/test/ELF/icf10.test | 38 | ||||
-rw-r--r-- | lld/test/ELF/relocation-dtrace.test | 23 | ||||
-rw-r--r-- | lld/test/ELF/relocation-none-aarch64.s | 24 | ||||
-rw-r--r-- | lld/test/ELF/relocation-none-aarch64.test | 23 | ||||
-rw-r--r-- | lld/test/ELF/relocation-none-arm.s | 17 | ||||
-rw-r--r-- | lld/test/ELF/relocation-none-i386.s | 17 | ||||
-rw-r--r-- | lld/test/ELF/relocation-none-i686.test | 22 | ||||
-rw-r--r-- | lld/test/ELF/relocation-none-x86-64.s | 24 |
11 files changed, 99 insertions, 114 deletions
diff --git a/lld/test/ELF/Inputs/dtrace-r.o b/lld/test/ELF/Inputs/dtrace-r.o Binary files differdeleted file mode 100644 index ce742de3bd2..00000000000 --- a/lld/test/ELF/Inputs/dtrace-r.o +++ /dev/null diff --git a/lld/test/ELF/dtrace-r.test b/lld/test/ELF/dtrace-r.test deleted file mode 100644 index 2b6d885d4c8..00000000000 --- a/lld/test/ELF/dtrace-r.test +++ /dev/null @@ -1,8 +0,0 @@ -RUN: ld.lld -r -o %t.o %p/Inputs/dtrace-r.o -RUN: llvm-readobj -r %t.o | FileCheck %s - -CHECK: Relocations [ -CHECK-NEXT: Section ({{.*}}) .rela.text { -CHECK-NEXT: 0x0 R_X86_64_NONE - 0x0 -CHECK-NEXT: } -CHECK-NEXT: ] diff --git a/lld/test/ELF/icf10.s b/lld/test/ELF/icf10.s new file mode 100644 index 00000000000..b782f924844 --- /dev/null +++ b/lld/test/ELF/icf10.s @@ -0,0 +1,17 @@ +# REQUIRES: x86 + +# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-freebsd %s -o %t.o +# RUN: ld.lld --icf=all %t.o -o /dev/null --print-icf-sections 2>&1 | FileCheck %s + +# Checks that ICF does not merge 2 sections the offset of +# the relocations of which differ. + +# CHECK-NOT: selected + +.section .text.foo,"ax" + .quad -1 + .reloc 0, R_X86_64_NONE, 0 + +.section .text.bar,"ax" + .quad -1 + .reloc 1, R_X86_64_NONE, 0 diff --git a/lld/test/ELF/icf10.test b/lld/test/ELF/icf10.test deleted file mode 100644 index 20963b2979d..00000000000 --- a/lld/test/ELF/icf10.test +++ /dev/null @@ -1,38 +0,0 @@ -# RUN: yaml2obj %s -o %t.o -# RUN: ld.lld --icf=all %t.o -o /dev/null --print-icf-sections 2>&1 | FileCheck %s - -# Checks that ICF does not merge 2 sections the offset of -# the relocations of which differ. - -# CHECK-NOT: selected - -!ELF -FileHeader: - Class: ELFCLASS64 - Data: ELFDATA2LSB - OSABI: ELFOSABI_FREEBSD - Type: ET_REL - Machine: EM_X86_64 -Sections: - - Name: .text.foo - Type: SHT_PROGBITS - Flags: [ SHF_ALLOC, SHF_EXECINSTR] - Content: "FFFFFFFFFFFFFFFF" - - Name: .text.bar - Type: SHT_PROGBITS - Flags: [ SHF_ALLOC, SHF_EXECINSTR] - Content: "FFFFFFFFFFFFFFFF" - - Name: .rela.text.foo - Type: SHT_RELA - Link: .symtab - Info: .text.foo - Relocations: - - Offset: 0x0000000000000000 - Type: R_X86_64_NONE - - Name: .rela.text.bar - Type: SHT_RELA - Link: .symtab - Info: .text.bar - Relocations: - - Offset: 0x0000000000000001 - Type: R_X86_64_NONE diff --git a/lld/test/ELF/relocation-dtrace.test b/lld/test/ELF/relocation-dtrace.test deleted file mode 100644 index 7f4d3ac26c9..00000000000 --- a/lld/test/ELF/relocation-dtrace.test +++ /dev/null @@ -1,23 +0,0 @@ -# RUN: yaml2obj %s -o %t.o -# RUN: ld.lld -shared %t.o -o /dev/null - -# Test that we can handle R_X86_64_NONE as produced by dtrace. - -!ELF -FileHeader: - Class: ELFCLASS64 - Data: ELFDATA2LSB - OSABI: ELFOSABI_FREEBSD - Type: ET_REL - Machine: EM_X86_64 -Sections: - - Name: .text - Type: SHT_PROGBITS - Flags: [ SHF_ALLOC ] - - Name: .rela.text - Type: SHT_RELA - Link: .symtab - Info: .text - Relocations: - - Offset: 0x0000000000000000 - Type: R_X86_64_NONE diff --git a/lld/test/ELF/relocation-none-aarch64.s b/lld/test/ELF/relocation-none-aarch64.s new file mode 100644 index 00000000000..e3265cf53ee --- /dev/null +++ b/lld/test/ELF/relocation-none-aarch64.s @@ -0,0 +1,24 @@ +# RUN: llvm-mc -filetype=obj -triple=aarch64-linux-musl %s -o %t.o +# RUN: ld.lld --gc-sections %t.o -o %t +# RUN: llvm-readelf -S -r %t | FileCheck %s + +# Test that we discard R_AARCH64_NONE, but respect the references it creates +# among sections. + +# CHECK: .data +# CHECK: There are no relocations in this file. + +# RUN: ld.lld -r %t.o -o %t +# RUN: llvm-readobj -r %t | FileCheck --check-prefix=RELOC %s + +# RELOC: Section ({{.*}}) .rela.text { +# RELOC-NEXT: 0x0 R_AARCH64_NONE .data 0x0 +# RELOC-NEXT: } + +.globl _start +_start: + ret + .reloc 0, R_AARCH64_NONE, .data + +.data + .long 0 diff --git a/lld/test/ELF/relocation-none-aarch64.test b/lld/test/ELF/relocation-none-aarch64.test deleted file mode 100644 index bdf4cb1437b..00000000000 --- a/lld/test/ELF/relocation-none-aarch64.test +++ /dev/null @@ -1,23 +0,0 @@ -# REQUIRES: aarch64 - -# RUN: yaml2obj %s -o %t.o -# RUN: ld.lld %t.o -o /dev/null - -!ELF -FileHeader: - Class: ELFCLASS64 - Data: ELFDATA2LSB - Type: ET_REL - Machine: EM_AARCH64 -Sections: - - Type: SHT_PROGBITS - Name: .text - Flags: [ SHF_ALLOC, SHF_EXECINSTR ] - Content: "00000000" - - Type: SHT_RELA - Name: .rela.text - Link: .symtab - Info: .text - Relocations: - - Offset: 0 - Type: R_AARCH64_NONE diff --git a/lld/test/ELF/relocation-none-arm.s b/lld/test/ELF/relocation-none-arm.s new file mode 100644 index 00000000000..7251db26e88 --- /dev/null +++ b/lld/test/ELF/relocation-none-arm.s @@ -0,0 +1,17 @@ +# RUN: llvm-mc -filetype=obj -triple=armv7-linux-musl %s -o %t.o +# RUN: ld.lld --gc-sections %t.o -o %t +# RUN: llvm-readelf -S -r %t | FileCheck %s + +# Test that we discard R_ARM_NONE, but respect the references it creates among +# sections. + +# CHECK: .data +# CHECK: There are no relocations in this file. + +.globl _start +_start: + nop + .reloc 0, R_ARM_NONE, .data + +.data + .long 0 diff --git a/lld/test/ELF/relocation-none-i386.s b/lld/test/ELF/relocation-none-i386.s new file mode 100644 index 00000000000..f56f63644a6 --- /dev/null +++ b/lld/test/ELF/relocation-none-i386.s @@ -0,0 +1,17 @@ +# RUN: llvm-mc -filetype=obj -triple=i386-linux-musl %s -o %t.o +# RUN: ld.lld --gc-sections %t.o -o %t +# RUN: llvm-readelf -S -r %t | FileCheck %s + +# Test that we discard R_386_NONE, but respect the +# references it creates among sections. + +# CHECK: .data +# CHECK: There are no relocations in this file. + +.globl _start +_start: + ret + .reloc 0, R_386_NONE, .data + +.data + .long 0 diff --git a/lld/test/ELF/relocation-none-i686.test b/lld/test/ELF/relocation-none-i686.test deleted file mode 100644 index 5e986765222..00000000000 --- a/lld/test/ELF/relocation-none-i686.test +++ /dev/null @@ -1,22 +0,0 @@ -# RUN: yaml2obj %s -o %t.o -# RUN: ld.lld %t.o -o /dev/null - -# Test that we can handle R_386_NONE. - -!ELF -FileHeader: - Class: ELFCLASS32 - Data: ELFDATA2LSB - Type: ET_REL - Machine: EM_386 -Sections: - - Name: .text - Type: SHT_PROGBITS - Flags: [ SHF_ALLOC ] - - Name: .rel.text - Type: SHT_RELA - Link: .symtab - Info: .text - Relocations: - - Offset: 0x0000000000000000 - Type: R_386_NONE diff --git a/lld/test/ELF/relocation-none-x86-64.s b/lld/test/ELF/relocation-none-x86-64.s new file mode 100644 index 00000000000..8e477a4606d --- /dev/null +++ b/lld/test/ELF/relocation-none-x86-64.s @@ -0,0 +1,24 @@ +# RUN: llvm-mc -filetype=obj -triple=x86_64-linux-musl %s -o %t.o +# RUN: ld.lld --gc-sections %t.o -o %t +# RUN: llvm-readelf -S -r %t | FileCheck %s + +# Test that we discard R_X86_64_NONE, but respect the +# references it creates among sections. + +# CHECK: .data +# CHECK: There are no relocations in this file. + +# RUN: ld.lld -r %t.o -o %t +# RUN: llvm-readobj -r %t | FileCheck --check-prefix=RELOC %s + +# RELOC: Section ({{.*}}) .rela.text { +# RELOC-NEXT: 0x0 R_X86_64_NONE .data 0x0 +# RELOC-NEXT: } + +.globl _start +_start: + ret + .reloc 0, R_X86_64_NONE, .data + +.data + .long 0 |