Rafael Espindola e979fd1bf0 Don't put ro before rx when using linker scripts.
Since they end up going on the same PT_LOAD, there is no reason to
sort them. This matches bfd's behaviour and is user visible in the
placement of orphan sections.

llvm-svn: 282799
2016-09-29 22:48:55 +00:00

30 lines
719 B
ArmAsm

# 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
# 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 .symtab
# CHECK-NEXT: 8 .shstrtab
# CHECK-NEXT: 9 .strtab