diff options
Diffstat (limited to 'test/elf/Mips/tls-5-64.test')
-rw-r--r-- | test/elf/Mips/tls-5-64.test | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/test/elf/Mips/tls-5-64.test b/test/elf/Mips/tls-5-64.test new file mode 100644 index 0000000000000..784d71efc48f4 --- /dev/null +++ b/test/elf/Mips/tls-5-64.test @@ -0,0 +1,71 @@ +# Check that in case of an executable file linking symbol referred +# by the R_MIPS_TLS_GD relocation gets an entry in the dynamic symbol table. + +# RUN: yaml2obj -format=elf -o %t-o.o %s +# RUN: lld -flavor gnu -target mips64el -e T0 -o %t.exe %t-o.o + +# Check dynamic relocations: +# RUN: llvm-readobj -r %t.exe | FileCheck -check-prefix=REL %s +# Check dynamic symbol table: +# RUN: llvm-readobj -dt %t.exe | FileCheck -check-prefix=SYM %s + +# REL: Relocations [ +# REL-NEXT: Section (5) .rel.dyn { +# REL-NEXT: 0x120002010 R_MIPS_TLS_DTPMOD64/R_MIPS_NONE/R_MIPS_NONE T1 0x0 +# REL-NEXT: 0x120002018 R_MIPS_TLS_DTPREL64/R_MIPS_NONE/R_MIPS_NONE T1 0x0 +# REL-NEXT: } +# REL-NEXT: ] + +# SYM: Symbol { +# SYM: Name: T1@ (1) +# SYM-NEXT: Value: 0x0 +# SYM-NEXT: Size: 8 +# SYM-NEXT: Binding: Global (0x1) +# SYM-NEXT: Type: TLS (0x6) +# SYM-NEXT: Other: 0 +# SYM-NEXT: Section: .tdata (0x7) +# SYM-NEXT: } + +--- +FileHeader: + Class: ELFCLASS64 + Data: ELFDATA2LSB + Type: ET_REL + Machine: EM_MIPS + Flags: [EF_MIPS_NOREORDER, EF_MIPS_PIC, EF_MIPS_CPIC, EF_MIPS_ARCH_64] + +Sections: + - Name: .text + Type: SHT_PROGBITS + Flags: [ SHF_ALLOC, SHF_EXECINSTR ] + AddressAlign: 0x10 + Size: 8 + + - Name: .rel.text + Type: SHT_REL + Link: .symtab + AddressAlign: 4 + Info: .text + Relocations: + - Offset: 0 + Symbol: T1 + Type: R_MIPS_TLS_GD + + - Name: .tdata + Type: SHT_PROGBITS + Flags: [ SHF_WRITE, SHF_ALLOC, SHF_TLS ] + AddressAlign: 4 + Size: 8 + +Symbols: + Global: + - Name: T0 + Type: STT_FUNC + Section: .text + Size: 8 + - Name: T1 + Type: STT_TLS + Section: .tdata + Value: 0 + Size: 8 +... |