2018-06-27 00:58:19 +08:00
|
|
|
# REQUIRES: mips
|
2015-10-12 23:10:02 +08:00
|
|
|
# Check R_MIPS_32 relocation calculation.
|
2015-10-14 22:24:46 +08:00
|
|
|
|
2019-09-10 06:04:20 +08:00
|
|
|
# RUN: echo "SECTIONS { \
|
|
|
|
# RUN: . = 0x10000; .data ALIGN(0x1000) : { *(.data) } \
|
|
|
|
# RUN: }" > %t.script
|
|
|
|
|
2015-10-14 22:24:46 +08:00
|
|
|
# RUN: llvm-mc -filetype=obj -triple=mips-unknown-linux %s -o %t-be.o
|
2019-09-10 06:04:20 +08:00
|
|
|
# RUN: ld.lld -shared %t-be.o -script %t.script -o %t-be.so
|
2020-03-16 08:47:44 +08:00
|
|
|
# RUN: llvm-objdump -t -s %t-be.so | FileCheck --check-prefixes=SYM,BE %s
|
2019-10-03 20:08:04 +08:00
|
|
|
# RUN: llvm-readelf -r -s --dynamic-table -A %t-be.so \
|
2016-04-21 05:40:33 +08:00
|
|
|
# RUN: | FileCheck -check-prefix=REL %s
|
2015-10-14 22:24:46 +08:00
|
|
|
|
|
|
|
# RUN: llvm-mc -filetype=obj -triple=mipsel-unknown-linux %s -o %t-el.o
|
2019-09-10 06:04:20 +08:00
|
|
|
# RUN: ld.lld -shared %t-el.o -script %t.script -o %t-el.so
|
2020-03-16 08:47:44 +08:00
|
|
|
# RUN: llvm-objdump -t -s %t-el.so | FileCheck --check-prefixes=SYM,EL %s
|
2020-03-04 11:49:14 +08:00
|
|
|
# RUN: llvm-readelf --dynamic-table -r -s -A %t-el.so \
|
2016-04-21 05:40:33 +08:00
|
|
|
# RUN: | FileCheck -check-prefix=REL %s
|
2015-10-12 23:10:02 +08:00
|
|
|
|
|
|
|
.data
|
|
|
|
.globl v2
|
2019-09-06 15:23:02 +08:00
|
|
|
v1:
|
2015-10-12 23:10:02 +08:00
|
|
|
.word v2+4 # R_MIPS_32 target v2 addend 4
|
2019-09-06 15:23:02 +08:00
|
|
|
v2:
|
2015-10-12 23:10:02 +08:00
|
|
|
.word v1 # R_MIPS_32 target v1 addend 0
|
|
|
|
|
[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: SYMBOL TABLE:
|
2020-03-05 09:19:18 +08:00
|
|
|
# SYM: 00011000 l .data 00000000 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
|
|
|
|
2015-10-14 22:24:46 +08:00
|
|
|
# BE: Contents of section .data:
|
2019-09-10 06:04:20 +08:00
|
|
|
# BE-NEXT: {{.*}} 00000004 00011000
|
2019-09-06 15:23:02 +08:00
|
|
|
# ^-- v2+4 ^-- v1
|
2015-10-14 22:24:46 +08:00
|
|
|
|
|
|
|
# EL: Contents of section .data:
|
2019-09-10 06:04:20 +08:00
|
|
|
# EL-NEXT: {{.*}} 04000000 00100100
|
2019-09-06 15:23:02 +08:00
|
|
|
# ^-- v2+4 ^-- v1
|
2020-03-04 11:49:14 +08:00
|
|
|
|
|
|
|
# REL: Dynamic section
|
|
|
|
# REL: (RELSZ) 16
|
|
|
|
# REL: (RELENT) 8
|
|
|
|
# REL-NOT: (RELCOUNT)
|
|
|
|
|
2019-09-06 15:23:02 +08:00
|
|
|
# REL: Relocation section
|
2019-09-05 21:37:16 +08:00
|
|
|
# REL: {{.*}} R_MIPS_REL32
|
|
|
|
# REL-NEXT: {{.*}} R_MIPS_REL32 [[V2:[0-9a-f]+]]
|
2016-02-02 17:07:47 +08:00
|
|
|
|
2019-09-05 21:37:16 +08:00
|
|
|
# REL: Symbol table
|
2019-09-06 15:23:02 +08:00
|
|
|
# REL: {{.*}}: [[V2]] {{.*}} v2
|
2016-04-21 05:40:33 +08:00
|
|
|
|
2019-09-05 21:37:16 +08:00
|
|
|
# REL: Global entries
|
|
|
|
# REL: {{.*}} -32744(gp) [[V2]] {{.*}} v2
|