30 lines · plain
1// REQUIRES: x862// RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %p/Inputs/shared.s -o %t.o3// RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %p/Inputs/copy-in-shared.s -o %t2.o4// RUN: ld.lld -shared %t.o %t2.o -o %t.so5 6// ld.bfd and gold use .data.rel.ro rather than .bss.rel.ro. When a linker7// script, such as ld.bfd's internal linker script has a .data.rel.ro8// OutputSection we rename .bss.rel.ro to .data.rel.ro.bss in order to match in9// .data.rel.ro. This keeps the relro sections contiguous.10 11// Use the same sections and ordering as the ld.bfd internal linker script.12// RUN: echo "SECTIONS { \13// RUN: .data.rel.ro : { *(.data.rel.ro .data.rel.ro.*) } \14// RUN: .dynamic : { *(.dynamic) } \15// RUN: .got : { *(.got) } \16// RUN: .got.plt : { *(.got.plt) } \17// RUN: } " > %t.script18// RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t3.o19// RUN: ld.lld %t3.o %t.so -o /dev/null --script=%t.script --print-map | FileCheck %s20 21// CHECK: .data.rel.ro22// CHECK-NEXT: <internal>:(.bss.rel.ro)23 .section .text, "ax", @progbits24 .global _start25 .global bar26 .global foo27_start:28 .quad bar29 .quad foo30