llvm-project/lld/test/elf/X86_64/weak-override.test

46 lines
2.1 KiB
Plaintext

# Test for weak symbol getting overridden
RUN: lld -flavor gnu -target x86_64 %p/Inputs/weak.o %p/Inputs/ovrd.o \
RUN: -o %t --noinhibit-exec
RUN: llvm-nm %t | FileCheck -check-prefix=WEAKORDER %s
RUN: lld -flavor gnu -target x86_64 %p/Inputs/weak.o \
RUN: %p/Inputs/ovrd.o -o %t2 --output-filetype=yaml --noinhibit-exec
RUN: FileCheck -check-prefix=WEAKATOMSORDER %s < %t2
WEAKORDER: {{[0-9a-c]+}} T f
WEAKATOMSORDER: references:
WEAKATOMSORDER: - kind: layout-after
WEAKATOMSORDER: offset: 0
WEAKATOMSORDER: target: fn
WEAKATOMSORDER: - name: fn
WEAKATOMSORDER: references:
WEAKATOMSORDER: - kind: layout-after
WEAKATOMSORDER: offset: 0
WEAKATOMSORDER: target: [[CONSTSTRA:[-a-zA-Z0-9_]+]]
WEAKATOMSORDER: - ref-name: [[CONSTSTRA]]
WEAKATOMSORDER: scope: global
WEAKATOMSORDER: content: [ 55, 48, 89, E5, BF, 00, 00, 00, 00, E8, 00, 00,
WEAKATOMSORDER: 00, 00, 5D, C3 ]
WEAKATOMSORDER: references:
WEAKATOMSORDER: - kind: layout-after
WEAKATOMSORDER: offset: 0
WEAKATOMSORDER: target: main
WEAKATOMSORDER: - name: main
WEAKATOMSORDER: scope: global
WEAKATOMSORDER: content: [ 55, 48, 89, E5, B8, 00, 00, 00, 00, E8, 00, 00,
WEAKATOMSORDER: 00, 00, B8, 00, 00, 00, 00, 5D, C3 ]
WEAKATOMSORDER: references:
WEAKATOMSORDER: - kind: R_X86_64_PC32
WEAKATOMSORDER: offset: 10
WEAKATOMSORDER: target: f
WEAKATOMSORDER: addend: -4
WEAKATOMSORDER: - ref-name: {{[0-9A-Z]+}}
WEAKATOMSORDER: references:
WEAKATOMSORDER: - kind: layout-after
WEAKATOMSORDER: offset: 0
WEAKATOMSORDER: target: f
WEAKATOMSORDER: - name: f
WEAKATOMSORDER: scope: global
WEAKATOMSORDER: content: [ 55, 48, 89, E5, BF, 00, 00, 00, 00, E8, 00, 00,
WEAKATOMSORDER: 00, 00, 5D, C3 ]