2018-05-17 18:00:34 +08:00
|
|
|
# REQUIRES: x86
|
|
|
|
# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o
|
|
|
|
# RUN: ld.lld %t.o -o %t1 --gc-sections
|
2020-03-16 08:47:44 +08:00
|
|
|
# RUN: llvm-objdump --section-headers -D %t1 | FileCheck %s
|
2018-05-17 18:00:34 +08:00
|
|
|
|
|
|
|
## Check that we are able to GC non-allocatable metadata sections without crash.
|
|
|
|
|
[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: Name Size
|
|
|
|
# CHECK: .stack_sizes 00000001
|
|
|
|
|
2018-05-17 18:00:34 +08:00
|
|
|
# CHECK: Disassembly of section .stack_sizes:
|
2019-05-01 18:40:48 +08:00
|
|
|
# CHECK-EMPTY:
|
2020-03-06 06:18:38 +08:00
|
|
|
# CHECK-NEXT: <.stack_sizes>:
|
2018-05-17 18:00:34 +08:00
|
|
|
# CHECK-NEXT: 01
|
|
|
|
|
|
|
|
.section .text.live,"ax",@progbits
|
|
|
|
.globl live
|
|
|
|
live:
|
|
|
|
nop
|
|
|
|
|
|
|
|
.section .stack_sizes,"o",@progbits,.text.live,unique,0
|
|
|
|
.byte 1
|
|
|
|
|
|
|
|
.section .text.dead,"ax",@progbits
|
|
|
|
.globl dead
|
|
|
|
dead:
|
|
|
|
nop
|
|
|
|
|
|
|
|
.section .stack_sizes,"o",@progbits,.text.dead,unique,1
|
|
|
|
.byte 2
|
|
|
|
|
|
|
|
.section .text.main,"ax",@progbits
|
|
|
|
.globl _start
|
|
|
|
_start:
|
|
|
|
callq live@PLT
|