2018-06-27 00:58:19 +08:00
|
|
|
# REQUIRES: mips
|
2016-05-05 06:39:40 +08:00
|
|
|
# Check R_MIPS_64 relocation calculation.
|
|
|
|
|
|
|
|
# RUN: llvm-mc -filetype=obj -triple=mips64-unknown-linux %s -o %t.o
|
|
|
|
# RUN: ld.lld -shared %t.o -o %t.so
|
2020-03-16 08:47:44 +08:00
|
|
|
# RUN: llvm-objdump -s -t %t.so | FileCheck --check-prefix=SYM %s
|
2020-03-04 11:49:14 +08:00
|
|
|
# RUN: llvm-readelf --dynamic-table -r -s -A %t.so | FileCheck %s
|
2016-05-05 06:39:40 +08:00
|
|
|
|
|
|
|
.data
|
|
|
|
.globl v2
|
2019-09-06 15:23:02 +08:00
|
|
|
v1:
|
2016-05-05 06:39:40 +08:00
|
|
|
.quad v2+8 # R_MIPS_64 target v2 addend 8
|
2019-09-06 15:23:02 +08:00
|
|
|
v2:
|
2016-05-05 06:39:40 +08:00
|
|
|
.quad v1 # R_MIPS_64 target v1 addend 0
|
|
|
|
|
|
|
|
# SYM: SYMBOL TABLE:
|
2020-03-05 09:19:18 +08:00
|
|
|
# SYM: 00000000[[V1:[0-9a-f]+]] l .data 0000000000000000 v1
|
[llvm-objdump] Further rearrange llvm-objdump sections for compatability
Summary:
rL371826 rearranged some output from llvm-objdump for GNU objdump compatability, but there still seem to be some more.
I think this rearrangement is a little closer. Overview of the ordering which matches GNU objdump:
* Archive headers
* File headers
* Section headers
* Symbol table
* Dwarf debugging
* Relocations (if `--disassemble` is not used)
* Section contents
* Disassembly
Reviewers: jhenderson, justice_adams, grimar, ychen, espindola
Reviewed By: jhenderson
Subscribers: aprantl, emaste, arichardson, jrtc27, atanasyan, seiya, llvm-commits, MaskRay
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D68066
llvm-svn: 373671
2019-10-04 06:01:08 +08:00
|
|
|
|
|
|
|
# SYM: Contents of section .data:
|
|
|
|
# SYM-NEXT: {{.*}} 00000000 00000008 00000000 [[V1]]
|
2019-09-06 15:23:02 +08:00
|
|
|
|
2020-03-04 11:49:14 +08:00
|
|
|
# CHECK: Dynamic section
|
|
|
|
# CHECK: (RELSZ) 32 (bytes)
|
|
|
|
# CHECK: (RELENT) 16 (bytes)
|
|
|
|
|
2019-09-06 15:23:02 +08:00
|
|
|
# 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: Primary GOT:
|
|
|
|
# CHECK: Global entries:
|
|
|
|
# CHECK: {{.*}} -32736(gp) [[V2]] [[V2]] {{.*}} v2
|