2016-09-22 06:36:19 +08:00
|
|
|
# REQUIRES: x86
|
|
|
|
# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o
|
|
|
|
|
|
|
|
# RUN: echo "SECTIONS { \
|
|
|
|
# RUN: .text : { *(.text) } \
|
|
|
|
# RUN: foo : { *(foo) } \
|
|
|
|
# RUN: } " > %t.script
|
|
|
|
# RUN: ld.lld -o %t --script %t.script %t.o -shared
|
|
|
|
# RUN: llvm-objdump --section-headers %t | FileCheck %s
|
|
|
|
|
|
|
|
# Test the section order. This is a case where at least with libstdc++'s
|
|
|
|
# stable_sort we used to get a different result.
|
|
|
|
|
|
|
|
nop
|
|
|
|
|
|
|
|
.section foo, "a"
|
|
|
|
.byte 0
|
|
|
|
|
|
|
|
# CHECK: Id
|
|
|
|
# CHECK-NEXT: 0
|
2016-09-30 06:48:55 +08:00
|
|
|
# CHECK-NEXT: 1 .text
|
|
|
|
# CHECK-NEXT: 2 foo
|
|
|
|
# CHECK-NEXT: 3 .dynsym
|
|
|
|
# CHECK-NEXT: 4 .hash
|
|
|
|
# CHECK-NEXT: 5 .dynstr
|
2016-09-22 06:36:19 +08:00
|
|
|
# CHECK-NEXT: 6 .dynamic
|
2016-11-11 04:20:37 +08:00
|
|
|
# CHECK-NEXT: 7 .comment
|
|
|
|
# CHECK-NEXT: 8 .symtab
|
|
|
|
# CHECK-NEXT: 9 .shstrtab
|
|
|
|
# CHECK-NEXT: 10 .strtab
|