# RUN: llvm-readelf -r -s --dynamic-table --mips-plt-got %t-el.so \
# RUN: | FileCheck -check-prefix=REL %s
- .globl __start
-__start:
- nop
-
.data
- .type v1,@object
- .size v1,4
-v1:
- .word 0
-
.globl v2
- .type v2,@object
- .size v2,8
-v2:
+v1:
.word v2+4 # R_MIPS_32 target v2 addend 4
+v2:
.word v1 # R_MIPS_32 target v1 addend 0
# BE: Contents of section .data:
-# BE-NEXT: {{.*}} 00000000 00000004 00020000
-# ^-- v2+4 ^-- v1
+# BE-NEXT: {{.*}} 00000004 00010000
+# ^-- v2+4 ^-- v1
# EL: Contents of section .data:
-# EL-NEXT: {{.*}} 00000000 04000000 00000200
-# ^-- v2+4 ^-- v1
+# EL-NEXT: {{.*}} 04000000 00000100
+# ^-- v2+4 ^-- v1
# SYM: SYMBOL TABLE:
-# SYM: 00020000 l O .data 00000004 v1
+# SYM: 00010000 .data 00000000 v1
-# Relocation section
+# REL: Relocation section
# REL: {{.*}} R_MIPS_REL32
# REL-NEXT: {{.*}} R_MIPS_REL32 [[V2:[0-9a-f]+]]
# REL: Symbol table
-# REL: {{.*}} [[V2]] {{.*}} v2
+# REL: {{.*}}: [[V2]] {{.*}} v2
-# Dynamic section
+# REL: Dynamic section
# REL: (RELSZ) 16
# REL: (RELENT) 8
# REL-NOT: (RELCOUNT)
# RUN: llvm-mc -filetype=obj -triple=mips64-unknown-linux %s -o %t2.so.o
# RUN: ld.lld -shared -mips-got-size 32 %t1.so.o %t2.so.o -o %t-sgot.so
# RUN: ld.lld -shared -mips-got-size 24 %t1.so.o %t2.so.o -o %t-mgot.so
-# RUN: llvm-readelf --mips-plt-got %t-sgot.so | FileCheck -check-prefix=SGOT %s
-# RUN: llvm-readelf --mips-plt-got %t-mgot.so | FileCheck -check-prefix=MGOT %s
+# RUN: llvm-readelf -s --mips-plt-got %t-sgot.so \
+# RUN: | FileCheck -check-prefixes=SYM,SGOT %s
+# RUN: llvm-readelf -s --mips-plt-got %t-mgot.so \
+# RUN: | FileCheck -check-prefixes=SYM,MGOT %s
+
+# SYM: Symbol table '.symtab'
+# SYM: {{.*}}: [[LOC1:[0-9a-f]+]] {{.*}} local1
+# SYM: {{.*}}: [[LOC2:[0-9a-f]+]] {{.*}} local2
# SGOT: Primary GOT:
-# SGOT-NEXT: Canonical gp value: 0000000000027ff0
+# SGOT-NEXT: Canonical gp value:
# SGOT-EMPTY:
# SGOT-NEXT: Reserved entries:
-# SGOT-NEXT: Address Access Initial Purpose
-# SGOT-NEXT: 0000000000020000 -32752(gp) 0000000000000000 Lazy resolver
-# SGOT-NEXT: 0000000000020008 -32744(gp) 8000000000000000 Module pointer (GNU extension)
+# SGOT-NEXT: Address Access Initial Purpose
+# SGOT-NEXT: {{.*}} -32752(gp) 0000000000000000 Lazy resolver
+# SGOT-NEXT: {{.*}} -32744(gp) 8000000000000000 Module pointer (GNU extension)
# SGOT-EMPTY:
# SGOT-NEXT: Local entries:
-# SGOT-NEXT: Address Access Initial
-# SGOT-NEXT: 0000000000020010 -32736(gp) 0000000000020020
-# SGOT-NEXT: 0000000000020018 -32728(gp) 0000000000020030
+# SGOT-NEXT: Address Access Initial
+# SGOT-NEXT: {{.*}} -32736(gp) [[LOC1]]
+# SGOT-NEXT: {{.*}} -32728(gp) [[LOC2]]
# MGOT: Primary GOT:
-# MGOT-NEXT: Canonical gp value: 0000000000027ff0
+# MGOT-NEXT: Canonical gp value:
# MGOT-EMPTY:
# MGOT-NEXT: Reserved entries:
-# MGOT-NEXT: Address Access Initial Purpose
-# MGOT-NEXT: 0000000000020000 -32752(gp) 0000000000000000 Lazy resolver
-# MGOT-NEXT: 0000000000020008 -32744(gp) 8000000000000000 Module pointer (GNU extension)
+# MGOT-NEXT: Address Access Initial Purpose
+# MGOT-NEXT: {{.*}} -32752(gp) 0000000000000000 Lazy resolver
+# MGOT-NEXT: {{.*}} -32744(gp) 8000000000000000 Module pointer (GNU extension)
# MGOT-EMPTY:
# MGOT-NEXT: Local entries:
-# MGOT-NEXT: Address Access Initial
-# MGOT-NEXT: 0000000000020010 -32736(gp) 0000000000020020
+# MGOT-NEXT: Address Access Initial
+# MGOT-NEXT: {{.*}} -32736(gp) [[LOC1]]
# MGOT-EMPTY:
# MGOT-NEXT: Number of TLS and multi-GOT entries 1
# RUN: llvm-mc -filetype=obj -triple=mips64-unknown-linux \
# RUN: %p/Inputs/mips-pic.s -o %t.so.o
# RUN: llvm-mc -filetype=obj -triple=mips64-unknown-linux %s -o %t.exe.o
+# RUN: echo "SECTIONS { . = 0x30000; .text : { *(.text) } }" > %t.script
# RUN: ld.lld %t.so.o -shared -soname=t.so -o %t.so
-# RUN: ld.lld %t.exe.o %t.so -o %t.exe
+# RUN: ld.lld %t.exe.o --script %t.script %t.so -o %t.exe
# RUN: llvm-objdump -d -t --no-show-raw-insn %t.exe | FileCheck %s
-# RUN: llvm-readelf -r --mips-plt-got %t.exe | FileCheck -check-prefix=GOT %s
+# RUN: llvm-readelf -r -s --mips-plt-got %t.exe | FileCheck -check-prefix=GOT %s
# CHECK: __start:
+# CHECK-NEXT: {{.*}} ld $2, -32736($gp)
+# CHECK-NEXT: {{.*}} daddiu $2, $2, 456
+# CHECK-NEXT: {{.*}} addiu $2, $2, -32704
+# CHECK-NEXT: {{.*}} addiu $2, $2, -32720
+# CHECK-NEXT: {{.*}} addiu $2, $2, -32712
-# CHECK-NEXT: 20000: ld $2, -32736($gp)
-# CHECK-NEXT: 20004: daddiu $2, $2, 24
-# CHECK-NEXT: 20008: addiu $2, $2, -32704
-# CHECK-NEXT: 2000c: addiu $2, $2, -32720
-# CHECK-NEXT: 20010: addiu $2, $2, -32712
+# CHECK: {{[0-9a-f]+}}1c8 .text 00000000 foo
-# CHECK: 0000000000020018 .text 00000000 foo
-# CHECK: 0000000000020000 .text 00000000 __start
-# CHECK: 0000000000020014 .text 00000000 bar
+# GOT: There are no relocations in this file.
-# GOT: There are no relocations in this file.
-# GOT-NEXT: Primary GOT:
-# GOT-NEXT: Canonical gp value: 0000000000038000
+# GOT: Symbol table '.symtab'
+# GOT: {{.*}}: [[FOO:[0-9a-f]+]] {{.*}} foo
+# GOT: {{.*}}: [[GP:[0-9a-f]+]] {{.*}} _gp
+# GOT: {{.*}}: [[BAR:[0-9a-f]+]] {{.*}} bar
+
+# GOT: Primary GOT:
+# GOT-NEXT: Canonical gp value: [[GP]]
# GOT-EMPTY:
# GOT-NEXT: Reserved entries:
-# GOT-NEXT: Address Access Initial Purpose
-# GOT-NEXT: 0000000000030010 -32752(gp) 0000000000000000 Lazy resolver
-# GOT-NEXT: 0000000000030018 -32744(gp) 8000000000000000 Module pointer (GNU extension)
+# GOT-NEXT: Address Access Initial Purpose
+# GOT-NEXT: {{.*}} -32752(gp) 0000000000000000 Lazy resolver
+# GOT-NEXT: {{.*}} -32744(gp) 8000000000000000 Module pointer (GNU extension)
# GOT-EMPTY:
# GOT-NEXT: Local entries:
-# GOT-NEXT: Address Access Initial
-# GOT-NEXT: 0000000000030020 -32736(gp) 0000000000020000
-# GOT-NEXT: 0000000000030028 -32728(gp) 0000000000030000
-# GOT-NEXT: 0000000000030030 -32720(gp) 0000000000020014
-# GOT-NEXT: 0000000000030038 -32712(gp) 0000000000020018
+# GOT-NEXT: Address Access Initial
+# GOT-NEXT: {{.*}} -32736(gp) 0000000000030000
+# GOT-NEXT: {{.*}} -32728(gp) 0000000000040000
+# GOT-NEXT: {{.*}} -32720(gp) [[BAR]]
+# GOT-NEXT: {{.*}} -32712(gp) [[FOO]]
# GOT-EMPTY:
# GOT-NEXT: Global entries:
-# GOT-NEXT: Address Access Initial Sym.Val. Type Ndx Name
-# GOT-NEXT: 0000000000030040 -32704(gp) 0000000000000000 0000000000000000 FUNC UND foo1a
+# GOT-NEXT: Address Access Initial Sym.Val. Type Ndx Name
+# GOT-NEXT: {{.*}} -32704(gp) 0000000000000000 0000000000000000 FUNC UND foo1a
.text
.global __start, bar
# Check setup of GP relative offsets in a function's prologue.
# RUN: llvm-mc -filetype=obj -triple=mips64-unknown-linux %s -o %t.o
-# RUN: ld.lld %t.o -shared -o %t.so
-# RUN: llvm-objdump -d -t %t.so | FileCheck %s
+# RUN: echo "SECTIONS { foo = 0x2000; _gp = 0x3000; }" > %t.script
+# RUN: ld.lld %t.o --script %t.script -shared -o %t.so
+# RUN: llvm-objdump -d -t --print-imm-hex --no-show-raw-insn %t.so | FileCheck %s
-# CHECK: Disassembly of section .text:
-# CHECK-EMPTY:
-# CHECK-NEXT: foo:
-# CHECK-NEXT: 10000: 3c 1c 00 01 lui $gp, 1
-# CHECK-NEXT: 10004: 03 99 e0 2d daddu $gp, $gp, $25
-# CHECK-NEXT: 10008: 67 9c 7f f0 daddiu $gp, $gp, 32752
-
-# CHECK: 0000000000027ff0 .got 00000000 .hidden _gp
-# CHECK: 0000000000010000 .text 00000000 foo
+# CHECK: {{.*}} lui $gp, 0x0
+# CHECK-NEXT: {{.*}} daddu $gp, $gp, $25
+# CHECK-NEXT: {{.*}} daddiu $gp, $gp, 0x1000
.text
- .global foo
-foo:
lui $gp,%hi(%neg(%gp_rel(foo)))
daddu $gp,$gp,$t9
daddiu $gp,$gp,%lo(%neg(%gp_rel(foo)))
# into the single relocation record.
# RUN: llvm-mc -filetype=obj -triple=mips64-unknown-linux %s -o %t.o
-# RUN: ld.lld %t.o -o %t.exe
-# RUN: llvm-objdump -d -s -t --no-show-raw-insn %t.exe | FileCheck %s
+# RUN: echo "SECTIONS { \
+# RUN: . = 0x20000; .text ALIGN(0x1000) : { *(.text) } \
+# RUN: . = 0x30000; .got : { *(.got) } \
+# RUN: }" > %t.script
+# RUN: ld.lld %t.o --script %t.script -o %t.exe
+# RUN: llvm-objdump -d -s -t --print-imm-hex --no-show-raw-insn %t.exe | FileCheck %s
# RUN: llvm-readobj -r %t.exe | FileCheck -check-prefix=REL %s
# CHECK: __start:
-# CHECK-NEXT: 20000: lui $gp, 1
-# ^-- 0x20000 - 0x37ff0
-# ^-- 0 - 0xfffffffffffe8010
-# ^-- %hi(0x17ff0)
+# CHECK-NEXT: 21000: lui $gp, 0x1
+# ^-- 0x21000 - 0x37ff0
+# ^-- 0 - 0xffffffffffff9010
+# ^-- %hi(0x16ff0)
# CHECK: loc:
-# CHECK-NEXT: 20004: daddiu $gp, $gp, 32752
-# ^-- 0x20000 - 0x37ff0
-# ^-- 0 - 0xfffffffffffe8010
-# ^-- %lo(0x17ff0)
+# CHECK-NEXT: 21004: daddiu $gp, $gp, 0x6ff0
+# ^-- 0x21000 - 0x37ff0
+# ^-- 0 - 0xfffffffffffe9010
+# ^-- %lo(0x16ff0)
# CHECK: Contents of section .rodata:
-# CHECK-NEXT: {{[0-9a-f]+}} ffffffff fffe8014
-# ^-- 0x20004 - 0x37ff0 = 0xfffffffffffe8014
+# CHECK-NEXT: {{[0-9a-f]+}} ffffffff fffe9014
+# ^-- 0x21004 - 0x37ff0 = 0xfffffffffffe9014
-# CHECK: 0000000000020004 .text 00000000 loc
# CHECK: 0000000000037ff0 .got 00000000 .hidden _gp
-# CHECK: 0000000000020000 .text 00000000 __start
# REL: Relocations [
# REL-NEXT: ]
# RUN: llvm-mc -filetype=obj -triple=mips64-unknown-linux %s -o %t.o
# RUN: ld.lld -shared %t.o -o %t.so
-# RUN: llvm-objdump -t %t.so | FileCheck -check-prefix=SYM %s
-# RUN: llvm-readobj -r --dynamic-table --mips-plt-got %t.so | FileCheck %s
-
- .global __start
-__start:
- nop
+# RUN: llvm-objdump -s -t %t.so | FileCheck -check-prefix=SYM %s
+# RUN: llvm-readelf -r -s --dynamic-table --mips-plt-got %t.so | FileCheck %s
.data
- .type v1,@object
- .size v1,4
-v1:
- .quad 0
-
.globl v2
- .type v2,@object
- .size v2,8
-v2:
+v1:
.quad v2+8 # R_MIPS_64 target v2 addend 8
+v2:
.quad v1 # R_MIPS_64 target v1 addend 0
+# SYM: Contents of section .data:
+# SYM-NEXT: {{.*}} 00000000 00000008 00000000 [[V1:[0-9a-f]+]]
# SYM: SYMBOL TABLE:
-# SYM: 00020000 l O .data 00000004 v1
-# SYM: 00020008 g O .data 00000008 v2
-
-# CHECK: Relocations [
-# CHECK-NEXT: Section (7) .rel.dyn {
-# CHECK-NEXT: 0x20010 R_MIPS_REL32/R_MIPS_64/R_MIPS_NONE - 0x0
-# CHECK-NEXT: 0x20008 R_MIPS_REL32/R_MIPS_64/R_MIPS_NONE v2 0x0
-# CHECK-NEXT: }
-# CHECK-NEXT: ]
-
-# CHECK: DynamicSection [
-# CHECK: Tag Type Name/Value
-# CHECK: 0x0000000000000012 RELSZ 32 (bytes)
-# CHECK: 0x0000000000000013 RELENT 16 (bytes)
-
-# CHECK: Primary GOT {
-# CHECK-NEXT: Canonical gp value:
-# CHECK-NEXT: Reserved entries [
-# CHECK: ]
-# CHECK-NEXT: Local entries [
-# CHECK-NEXT: ]
-# CHECK-NEXT: Global entries [
-# CHECK-NEXT: Entry {
-# CHECK-NEXT: Address:
-# CHECK-NEXT: Access:
-# CHECK-NEXT: Initial: 0x20008
-# CHECK-NEXT: Value: 0x20008
-# CHECK-NEXT: Type: Object
-# CHECK-NEXT: Section: .data
-# CHECK-NEXT: Name: v2
-# CHECK-NEXT: }
-# CHECK-NEXT: ]
-# CHECK-NEXT: Number of TLS and multi-GOT entries: 0
-# CHECK-NEXT: }
+# SYM: 00000000[[V1]] .data 00000000 v1
+
+# CHECK: Relocation section
+# CHECK: [[V2:[0-9a-f]+]] {{.*}} R_MIPS_REL32/R_MIPS_64/R_MIPS_NONE
+# CHECK: [[V1:[0-9a-f]+]] {{.*}} R_MIPS_REL32/R_MIPS_64/R_MIPS_NONE [[V2]] v2
+
+# CHECK: Symbol table '.symtab'
+# CHECK: {{.*}}: [[V1]] {{.*}} v1
+# CHECK: {{.*}}: [[V2]] {{.*}} v2
+
+# CHECK: Dynamic section
+# CHECK: (RELSZ) 32 (bytes)
+# CHECK: (RELENT) 16 (bytes)
+
+# CHECK: Primary GOT:
+# CHECK: Global entries:
+# CHECK: {{.*}} -32736(gp) [[V2]] [[V2]] {{.*}} v2
# RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux %s -o %t.o
# RUN: ld.lld %t.o -shared -o %t.so
-# RUN: llvm-objdump -d %t.so | FileCheck %s
-# RUN: llvm-readelf -r --mips-plt-got %t.so | FileCheck -check-prefix=GOT %s
+# RUN: llvm-objdump -d --no-show-raw-insn %t.so | FileCheck %s
+# RUN: llvm-readelf -r -s --mips-plt-got %t.so | FileCheck -check-prefix=GOT %s
# CHECK: Disassembly of section .text:
# CHECK-EMPTY:
# CHECK-NEXT: foo:
-# CHECK-NEXT: 10000: 3c 02 00 00 lui $2, 0
-# CHECK-NEXT: 10004: 8c 42 80 20 lw $2, -32736($2)
-# CHECK-NEXT: 10008: 3c 02 00 00 lui $2, 0
-# CHECK-NEXT: 1000c: 8c 42 80 18 lw $2, -32744($2)
-# CHECK-NEXT: 10010: 3c 02 00 00 lui $2, 0
-# CHECK-NEXT: 10014: 8c 42 80 1c lw $2, -32740($2)
+# CHECK-NEXT: {{.*}}: lui $2, 0
+# CHECK-NEXT: {{.*}}: lw $2, -32736($2)
+# CHECK-NEXT: {{.*}}: lui $2, 0
+# CHECK-NEXT: {{.*}}: lw $2, -32744($2)
+# CHECK-NEXT: {{.*}}: lui $2, 0
+# CHECK-NEXT: {{.*}}: lw $2, -32740($2)
+
+# GOT: There are no relocations in this file.
+
+# GOT: Symbol table '.symtab'
+# GOT: {{.*}}: [[LOC1:[0-9a-f]+]] {{.*}} loc1
+# GOT: {{.*}}: [[LOC2:[0-9a-f]+]] {{.*}} loc2
-# GOT: There are no relocations in this file.
# GOT: Primary GOT:
-# GOT-NEXT: Canonical gp value: 00027ff0
+# GOT-NEXT: Canonical gp value:
# GOT-EMPTY:
# GOT-NEXT: Reserved entries:
# GOT-NEXT: Address Access Initial Purpose
-# GOT-NEXT: 00020000 -32752(gp) 00000000 Lazy resolver
-# GOT-NEXT: 00020004 -32748(gp) 80000000 Module pointer (GNU extension)
+# GOT-NEXT: {{.*}} -32752(gp) 00000000 Lazy resolver
+# GOT-NEXT: {{.*}} -32748(gp) 80000000 Module pointer (GNU extension)
# GOT-EMPTY:
# GOT-NEXT: Local entries:
# GOT-NEXT: Address Access Initial
-# GOT-NEXT: 00020008 -32744(gp) 00010018
-# GOT-NEXT: 0002000c -32740(gp) 0001001c
+# GOT-NEXT: {{.*}} -32744(gp) [[LOC1]]
+# GOT-NEXT: {{.*}} -32740(gp) [[LOC2]]
# GOT-EMPTY:
# GOT-NEXT: Global entries:
# GOT-NEXT: Address Access Initial Sym.Val. Type Ndx Name
-# GOT-NEXT: 00020010 -32736(gp) 00000000 00000000 NOTYPE UND bar
+# GOT-NEXT: {{.*}} -32736(gp) 00000000 00000000 NOTYPE UND bar
.text
.global foo
# RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux %s -o %t.o
# RUN: ld.lld %t.o -shared -o %t.so
# RUN: llvm-objdump -d --no-show-raw-insn %t.so | FileCheck %s
-# RUN: llvm-readobj --mips-plt-got --symbols %t.so \
+# RUN: llvm-readelf --mips-plt-got --symbols %t.so \
# RUN: | FileCheck -check-prefix=GOT %s
.text
# CHECK: Disassembly of section .text:
# CHECK-EMPTY:
# CHECK-NEXT: __start:
-# CHECK-NEXT: 10000: lw $8, -32744
+# CHECK-NEXT: {{.*}}: lw $8, -32744
-# GOT: Name: g1
-# GOT-NEXT: Value: 0x[[ADDR:[0-9A-F]+]]
+# GOT: Symbol table '.symtab'
+# GOT: {{.*}}: [[G1:[0-9a-f]+]] {{.*}} g1
-# GOT: Local entries [
-# GOT-NEXT: ]
-# GOT-NEXT: Global entries [
-# GOT-NEXT: Entry {
-# GOT-NEXT: Address:
-# GOT-NEXT: Access: -32744
-# GOT-NEXT: Initial: 0x[[ADDR]]
-# GOT-NEXT: Value: 0x[[ADDR]]
-# GOT-NEXT: Type: Function
-# GOT-NEXT: Section: .text
-# GOT-NEXT: Name: g1
-# GOT-NEXT: }
-# GOT-NEXT: ]
+# GOT: Primary GOT:
+# GOT: Global entries:
+# GOT: {{.*}} -32744(gp) [[G1]] [[G1]] FUNC 7 g1
# RUN: ld.lld -shared %t.so.o -o %t.so
# RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux %s -o %t.o
# RUN: ld.lld %t.o %t.so -o %t.exe
-# RUN: llvm-readobj --dyn-syms --symbols --mips-plt-got %t.exe | FileCheck %s
+# RUN: llvm-readelf --dyn-syms --symbols --mips-plt-got %t.exe | FileCheck %s
-# CHECK: Symbols [
-# CHECK: Symbol {
-# CHECK: Name: _foo
-# CHECK-NEXT: Value: 0x0
-# CHECK-NEXT: Size: 0
-# CHECK-NEXT: Binding: Global
+# CHECK: Symbol table '.dynsym'
+# CHECK-NOT: bar
-# CHECK: Symbol {
-# CHECK: Name: bar
-# CHECK-NEXT: Value: 0x20008
-# CHECK-NEXT: Size: 0
-# CHECK-NEXT: Binding: Global
+# CHECK: Symbol table '.symtab'
+# CHECK: {{.*}}: 00000000 {{.*}} _foo
+# CHECK: {{.*}}: [[BAR:[0-9a-f]+]] {{.*}} bar
-# CHECK: DynamicSymbols [
-# CHECK-NOT: Name: bar
-
-# CHECK: Local entries [
-# CHECK-NEXT: Entry {
-# CHECK-NEXT: Address:
-# CHECK-NEXT: Access: -32744
-# CHECK-NEXT: Initial: 0x20008
-# ^-- bar
-# CHECK-NEXT: }
-# CHECK-NEXT: ]
-# CHECK-NEXT: Global entries [
-# CHECK-NEXT: Entry {
-# CHECK-NEXT: Address:
-# CHECK-NEXT: Access: -32740
-# CHECK-NEXT: Initial: 0x0
-# CHECK-NEXT: Value: 0x0
-# CHECK-NEXT: Type: None
-# CHECK-NEXT: Section: Undefined
-# CHECK-NEXT: Name: _foo
-# CHECK-NEXT: }
-# CHECK-NEXT: ]
+# CHECK: Primary GOT:
+# CHECK: Local entries:
+# CHECK-NEXT: Address Access Initial
+# CHECK-NEXT: {{.*}} -32744(gp) [[BAR]]
+# CHECK-EMPTY:
+# CHECK-NEXT: Global entries:
+# CHECK-NEXT: Address Access Initial Sym.Val. Type Ndx Name
+# CHECK-NEXT: {{.*}} -32740(gp) 00000000 00000000 NOTYPE UND _foo
.text
.globl __start
# RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux %s -o %t.o
# RUN: ld.lld %t.o -shared -o %t.so
-# RUN: llvm-objdump -d %t.so | FileCheck %s
-# RUN: llvm-readobj -r --mips-plt-got %t.so | FileCheck -check-prefix=GOT %s
+# RUN: llvm-objdump -d --no-show-raw-insn %t.so | FileCheck %s
+# RUN: llvm-readelf -r -s --mips-plt-got %t.so | FileCheck -check-prefix=GOT %s
# CHECK: Disassembly of section .text:
# CHECK-EMPTY:
# CHECK-NEXT: foo:
-# CHECK-NEXT: 10000: 3c 02 00 00 lui $2, 0
-# CHECK-NEXT: 10004: 8c 42 80 20 lw $2, -32736($2)
-# CHECK-NEXT: 10008: 3c 02 00 00 lui $2, 0
-# CHECK-NEXT: 1000c: 8c 42 80 18 lw $2, -32744($2)
-# CHECK-NEXT: 10010: 3c 02 00 00 lui $2, 0
-# CHECK-NEXT: 10014: 8c 42 80 1c lw $2, -32740($2)
+# CHECK-NEXT: {{.*}}: lui $2, 0
+# CHECK-NEXT: {{.*}}: lw $2, -32736($2)
+# CHECK-NEXT: {{.*}}: lui $2, 0
+# CHECK-NEXT: {{.*}}: lw $2, -32744($2)
+# CHECK-NEXT: {{.*}}: lui $2, 0
+# CHECK-NEXT: {{.*}}: lw $2, -32740($2)
-# GOT: Relocations [
-# GOT-NEXT: ]
+# GOT: There are no relocations in this file
-# GOT: Primary GOT {
-# GOT-NEXT: Canonical gp value:
-# GOT: Local entries [
-# GOT-NEXT: Entry {
-# GOT-NEXT: Address:
-# GOT-NEXT: Access: -32744
-# GOT-NEXT: Initial: 0x20000
-# GOT-NEXT: }
-# GOT-NEXT: Entry {
-# GOT-NEXT: Address:
-# GOT-NEXT: Access: -32740
-# GOT-NEXT: Initial: 0x20004
-# GOT-NEXT: }
-# GOT-NEXT: ]
-# GOT-NEXT: Global entries [
-# GOT-NEXT: Entry {
-# GOT-NEXT: Address:
-# GOT-NEXT: Access: -32736
-# GOT-NEXT: Initial: 0x0
-# GOT-NEXT: Value: 0x0
-# GOT-NEXT: Type: None
-# GOT-NEXT: Section: Undefined
-# GOT-NEXT: Name: bar
-# GOT-NEXT: }
-# GOT-NEXT: ]
-# GOT-NEXT: Number of TLS and multi-GOT entries: 0
-# GOT-NEXT: }
+# GOT: Symbol table '.symtab'
+# GOT: {{.*}}: [[LOC1:[0-9a-f]+]] {{.*}} loc1
+# GOT: {{.*}}: [[LOC2:[0-9a-f]+]] {{.*}} loc2
+
+# GOT: Primary GOT:
+# GOT: Local entries:
+# GOT-NEXT: Address Access Initial
+# GOT-NEXT: {{.*}} -32744(gp) [[LOC1]]
+# GOT-NEXT: {{.*}} -32740(gp) [[LOC2]]
+# GOT-EMPTY:
+# GOT-NEXT: Global entries:
+# GOT-NEXT: Address Access Initial Sym.Val. Type Ndx Name
+# GOT-NEXT: {{.*}} -32736(gp) 00000000 00000000 NOTYPE UND bar
.text
.global foo
# RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux %s -o %t.o
# RUN: ld.lld %t.o -shared -o %t.so
-# RUN: llvm-readobj --mips-plt-got %t.so | FileCheck %s
+# RUN: llvm-readelf -s --mips-plt-got %t.so | FileCheck %s
-# CHECK: Local entries [
-# CHECK-NEXT: Entry {
-# CHECK-NEXT: Address:
-# CHECK-NEXT: Access: -32744
-# CHECK-NEXT: Initial: 0x20000
-# ^-- loc1
-# CHECK-NEXT: }
-# CHECK-NEXT: Entry {
-# CHECK-NEXT: Address:
-# CHECK-NEXT: Access: -32740
-# CHECK-NEXT: Initial: 0x30000
-# ^-- loc2, loc3, loc4
-# CHECK-NEXT: }
-# CHECK-NEXT: Entry {
-# CHECK-NEXT: Address:
-# CHECK-NEXT: Access: -32736
-# CHECK-NEXT: Initial: 0x40000
-# ^-- redundant
-# CHECK-NEXT: }
-# CHECK-NEXT: Entry {
-# CHECK-NEXT: Address:
-# CHECK-NEXT: Access: -32732
-# CHECK-NEXT: Initial: 0x30008
-# ^-- glb1
-# CHECK-NEXT: }
-# CHECK-NEXT: ]
+# CHECK: Symbol table '.symtab'
+# CHECK: {{.*}}: [[VAL:[0-9a-f]+]] {{.*}} glb1
+
+# CHECK: Primary GOT:
+# CHECK: Local entries:
+# CHECK-NEXT: Address Access Initial
+# CHECK-NEXT: {{.*}} -32744(gp) 00020000
+# CHECK-NEXT: {{.*}} -32740(gp) 00030000
+# CHECK-NEXT: {{.*}} -32736(gp) 00040000
+# CHECK-NEXT: {{.*}} -32732(gp) [[VAL]]
+# CHECK-NOT: {{.*}} -32728(gp)
.text
.globl foo