59 lines · plain
1# REQUIRES: x862## Check that section ordering follows from input file ordering.3# RUN: rm -rf %t; split-file %s %t4# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/1.s -o %t/1.o5# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/2.s -o %t/2.o6# RUN: %lld -dylib %t/1.o %t/2.o -o %t/127# RUN: %lld -dylib %t/2.o %t/1.o -o %t/218# RUN: %lld -dylib %t/2.o %t/1.o -o %t/synth-section-order \9# RUN: -add_empty_section __TEXT __objc_stubs \10# RUN: -add_empty_section __TEXT __init_offsets \11# RUN: -add_empty_section __TEXT __stubs \12# RUN: -add_empty_section __TEXT __stub_helper \13# RUN: -add_empty_section __TEXT __unwind_info \14# RUN: -add_empty_section __TEXT __eh_frame \15# RUN: -add_empty_section __DATA __objc_selrefs16# RUN: llvm-objdump --macho --section-headers %t/12 | FileCheck %s --check-prefix=CHECK-1217# RUN: llvm-objdump --macho --section-headers %t/21 | FileCheck %s --check-prefix=CHECK-2118# RUN: llvm-objdump --macho --section-headers %t/synth-section-order | FileCheck %s --check-prefix=CHECK-SYNTHETIC-ORDER19 20# CHECK-12: __text21# CHECK-12-NEXT: foo22# CHECK-12-NEXT: bar23# CHECK-12-NEXT: __cstring24 25# CHECK-21: __text26## `foo` always sorts next to `__text` since it's a code section27## and needs to be adjacent for arm64 thunk calculations28# CHECK-21-NEXT: foo29# CHECK-21-NEXT: __cstring30# CHECK-21-NEXT: bar31 32# CHECK-SYNTHETIC-ORDER: __text33# CHECK-SYNTHETIC-ORDER-NEXT: foo34# CHECK-SYNTHETIC-ORDER-NEXT: __stubs35# CHECK-SYNTHETIC-ORDER-NEXT: __stub_helper36# CHECK-SYNTHETIC-ORDER-NEXT: __objc_stubs37# CHECK-SYNTHETIC-ORDER-NEXT: __init_offsets38# CHECK-SYNTHETIC-ORDER-NEXT: __cstring39# CHECK-SYNTHETIC-ORDER-NEXT: bar40# CHECK-SYNTHETIC-ORDER-NEXT: __unwind_info41# CHECK-SYNTHETIC-ORDER-NEXT: __eh_frame42# CHECK-SYNTHETIC-ORDER-NEXT: __objc_selrefs43 44#--- 1.s45.section __TEXT,foo46 .space 147.section __TEXT,bar48 .space 149.cstring50 .asciz ""51 52#--- 2.s53.cstring54 .asciz ""55.section __TEXT,bar56 .space 157.section __TEXT,foo,regular,pure_instructions58 .space 159