2017-04-08 14:14:14 +08:00
|
|
|
# REQUIRES: x86
|
|
|
|
# RUN: llvm-mc -filetype=obj -triple=i686-pc-linux %s -o %t.o
|
|
|
|
# RUN: ld.lld %t.o -o %t
|
2020-03-16 08:47:44 +08:00
|
|
|
# RUN: llvm-objdump --section-headers -d %t | FileCheck %s
|
2017-04-08 14:14:14 +08:00
|
|
|
|
|
|
|
## We have R_386_GOT32 relocation here.
|
|
|
|
.globl foo
|
|
|
|
.type foo, @function
|
|
|
|
foo:
|
|
|
|
nop
|
|
|
|
|
|
|
|
_start:
|
|
|
|
movl foo@GOT, %ebx
|
|
|
|
|
|
|
|
## 73728 == 0x12000 == ADDR(.got)
|
|
|
|
# CHECK: Sections:
|
2019-01-28 23:03:47 +08:00
|
|
|
# CHECK: Name Size VMA
|
2019-10-15 01:47:17 +08:00
|
|
|
# CHECK: .got 00000004 004020fc
|
2020-03-06 06:18:38 +08:00
|
|
|
# CHECK: <_start>:
|
[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
|
|
|
# CHECK-NEXT: 4010f5: 8b 1d {{.*}} movl 4202748, %ebx
|
2017-04-08 14:14:14 +08:00
|
|
|
|
2020-02-13 13:48:45 +08:00
|
|
|
# RUN: not ld.lld %t.o -o /dev/null -pie 2>&1 | FileCheck %s --check-prefix=ERR
|
2019-08-19 22:30:12 +08:00
|
|
|
# ERR: error: symbol 'foo' cannot be preempted; recompile with -fPIE
|