76 lines · plain
1// REQUIRES: aarch64, x862/// Link against a DSO to ensure that sections are not discarded by --gc-sections.3// RUN: llvm-mc %S/Inputs/shared.s -o %ts.o -filetype=obj --triple=x86_644// RUN: ld.lld -shared -soname=ts %ts.o -o %ts.so5// RUN: llvm-mc %s -o %t.o -filetype=obj --triple=x86_64-unknown-linux6// RUN: ld.lld %t.o %ts.so -o %t --export-dynamic --gc-sections -z max-page-size=655367// RUN: llvm-readelf -S -s %t | FileCheck %s8 9// RUN: llvm-mc %S/Inputs/shared.s -o %ts.o -filetype=obj --triple=aarch6410// RUN: ld.lld -shared -soname=ts %ts.o -o %ts.so11// RUN: llvm-mc %s -o %t.o -filetype=obj --triple=aarch64 --crel12// RUN: ld.lld %t.o %ts.so -o %t --export-dynamic --gc-sections13// RUN: llvm-readelf -S -s %t | FileCheck %s14 15// This is basically lld/docs/partitions.dot in object file form.16// Test that the sections are correctly allocated to partitions.17// part1 and part2 should be aligned to a maximum page size boundary.18 19// CHECK: [[MAIN:[0-9]+]]] .text20// CHECK: part1 LLVM_PART_EHDR {{[0-9a-f]+}}0000 {{[0-9a-f]+}}000021// CHECK: [[P1:[0-9]+]]] .text22// CHECK: part2 LLVM_PART_EHDR {{[0-9a-f]+}}0000 {{[0-9a-f]+}}000023// CHECK: [[P2:[0-9]+]]] .text24 25// CHECK: Symbol table '.symtab'26// CHECK: [[MAIN]] f327// CHECK: [[P1]] f428// CHECK: [[MAIN]] f529// CHECK: [[P2]] f630// CHECK: [[P1]] f131// CHECK: [[P2]] f232// CHECK: [[MAIN]] _start33 34.section .llvm_sympart.f1,"",@llvm_sympart35.asciz "part1"36.quad f137 38.section .llvm_sympart.f2,"",@llvm_sympart39.asciz "part2"40.quad f241 42.section .text._start,"ax",@progbits43.globl _start44_start:45.quad f346 47.section .text.f1,"ax",@progbits48.globl f149f1:50.quad f351.quad f452.quad f553 54.section .text.f2,"ax",@progbits55.globl f256f2:57.quad f358.quad f559.quad f660 61.section .text.f3,"ax",@progbits62f3:63ret64 65.section .text.f4,"ax",@progbits66f4:67ret68 69.section .text.f5,"ax",@progbits70f5:71ret72 73.section .text.f6,"ax",@progbits74f6:75ret76