1# REQUIRES: x86 2# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o 3# RUN: echo "SECTIONS { .foo : { *(.foo) } }" > %t.script 4 5# RUN: ld.lld %t.o --script %t.script -o %t.out 6# RUN: llvm-objdump -s %t.out| FileCheck %s --check-prefix=BEFORE 7# BEFORE: Contents of section .foo: 8# BEFORE-NEXT: 1122 9 10# RUN: echo "_foo2" > %t.ord 11# RUN: echo "_foo1" >> %t.ord 12# RUN: ld.lld --symbol-ordering-file %t.ord %t.o --script %t.script -o %t2.out 13# RUN: llvm-objdump -s %t2.out| FileCheck %s --check-prefix=AFTER 14# AFTER: Contents of section .foo: 15# AFTER-NEXT: 2211 16 17# RUN: echo "SECTIONS { .text : { *(.text) } }" > %t2.script 18# RUN: ld.lld --symbol-ordering-file %t.ord %t.o --script %t2.script -o %t3.out 19# RUN: llvm-objdump -s %t3.out| FileCheck %s --check-prefix=AFTER 20 21# RUN: echo "SECTIONS { .foo : { BYTE(0x33); *(.foo); BYTE(0x44) } }" > %t3.script 22# RUN: ld.lld --symbol-ordering-file %t.ord %t.o --script %t3.script -o %t4.out 23# RUN: llvm-objdump -s %t4.out| FileCheck %s --check-prefix=COMMANDS 24# COMMANDS: Contents of section .foo: 25# COMMANDS-NEXT: 33221144 26 27.section .foo,"ax",@progbits,unique,1 28_foo1: 29 .byte 0x11 30 31.section .foo,"ax",@progbits,unique,2 32_foo2: 33 .byte 0x22 34