33 lines · plain
1# REQUIRES: x862 3## Test that DT_INIT_ARRAYSZ/DT_FINI_ARRAYSZ/DT_PREINIT_ARRAYSZ are computed4## correctly, no matter their associated sections are orphans or not.5 6# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t1.o7# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %p/Inputs/shared.s -o %t2.o8# RUN: ld.lld -shared %t2.o -soname=so -o %t2.so9 10# RUN: echo "SECTIONS { .init_array : { *(.init_array) } }" > %t.script11# RUN: ld.lld -T %t.script %t1.o %t2.so -o %t12# RUN: llvm-readobj --dynamic-table %t | FileCheck %s13 14# CHECK: DynamicSection [15# CHECK-NEXT: Tag Type Name/Value16# CHECK: 0x0000000000000021 PREINIT_ARRAYSZ 9 (bytes)17# CHECK: 0x000000000000001B INIT_ARRAYSZ 8 (bytes)18# CHECK: 0x000000000000001C FINI_ARRAYSZ 10 (bytes)19 20.globl _start21_start:22 23.section .init_array,"aw",@init_array24 .quad 025 26.section .preinit_array,"aw",@preinit_array27 .quad 028 .byte 029 30.section .fini_array,"aw",@fini_array31 .quad 032 .short 033