brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.6 KiB · 87969f0 Raw
46 lines · plain
1# REQUIRES: x862# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %tfile1.o3 4# RUN: echo "SECTIONS { .abc : { *(SORT(.foo.*) .a* .a* SORT(.bar.*) .b*) } }" > %t1.script5# RUN: ld.lld -o %t1 --script %t1.script %tfile1.o6# RUN: llvm-readelf -x .abc %t1 | FileCheck %s7 8## Sections matched by patterns between two SORT are sorted separately by input order.9## Note, GNU ld has a strange behavior with more than one SORT* https://sourceware.org/pipermail/binutils/2020-November/114083.html10## In the absence of SORT, our multi-pattern behavior matches GNU ld.11# CHECK:      Hex dump of section '.abc'12# CHECK-NEXT: 0x00000000 01020306 05040708 090b0c0a13 14# RUN: echo "SECTIONS { \15# RUN:   .abc : { *(SORT(.foo.* EXCLUDE_FILE (*file1.o) .bar.*) .a* SORT(.bar.*) .b*) } \16# RUN:  }" > %t2.script17# RUN: ld.lld -o %t2 --script %t2.script %tfile1.o18# RUN: llvm-readelf -x .abc %t2 | FileCheck %s19 20## Non-SORT patterns are sorted by --sort-section, breaking tie by input order.21# RUN: ld.lld -o %t4 --script %t1.script --sort-section=name %tfile1.o22# RUN: llvm-readelf -x .abc %t4 | FileCheck %s --check-prefix=CHECK223 24# CHECK2:      Hex dump of section '.abc'25# CHECK2-NEXT: 0x00000000 01020304 05060708 090a0b0c26 27.text28.globl _start29_start:30 31.section .foo.2,"a"; .byte 232.section .foo.3,"a"; .byte 333.section .foo.1,"a"; .byte 134 35.section .a6,"a"; .byte 636.section .a5,"a"; .byte 537.section .a4,"a"; .byte 438 39.section .bar.7,"a"; .byte 740.section .bar.9,"a"; .byte 941.section .bar.8,"a"; .byte 842 43.section .b11,"a"; .byte 1144.section .b12,"a"; .byte 1245.section .b10,"a"; .byte 1046