zig/deps/lld/test/ELF/linkerscript/sections-sort.s
Andrew Kelley 4794281d64 embed LLD 5.0.0
This is 48aaa9f66120f72b5d7e4a90b32fee40a3386ce9 from the
git monorepo.
2017-08-27 17:46:59 -04:00

28 lines
688 B
ArmAsm

# REQUIRES: x86
# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o
# RUN: echo "SECTIONS { .text : {*(.text)} foo : {*(foo)}}" > %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
# CHECK-NEXT: 1 .text
# CHECK-NEXT: 2 foo
# CHECK-NEXT: 3 .dynsym
# CHECK-NEXT: 4 .hash
# CHECK-NEXT: 5 .dynstr
# CHECK-NEXT: 6 .dynamic
# CHECK-NEXT: 7 .comment
# CHECK-NEXT: 8 .symtab
# CHECK-NEXT: 9 .shstrtab
# CHECK-NEXT: 10 .strtab