xref: /llvm-project-15.0.7/lld/test/ELF/protected-data-access.s (revision 0d4e6519)
  • Home
  • History
  • Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# REQUIRES: x86
2
3## Disallow copy relocation if the symbol is defined as protected in a DSO.
4
5# RUN: llvm-mc -triple x86_64-pc-linux -filetype=obj %p/Inputs/protected-data-access.s -o %t2.o
6# RUN: ld.lld %t2.o -o %t2.so -shared
7# RUN: llvm-mc -triple x86_64-pc-linux -filetype=obj %s -o %t.o
8
9# RUN: not ld.lld %t.o %t2.so -o %t 2>&1 | FileCheck --check-prefix=ERR %s
10# ERR: error: cannot preempt symbol: foo
11
12## Allow that if --ignore-data-address-equality is specified.
13
14# RUN: ld.lld --ignore-data-address-equality %t.o %t2.so -o %t
15# RUN: llvm-readobj --dyn-symbols --relocations %t | FileCheck %s
16
17# CHECK: R_X86_64_COPY foo 0x0
18
19# CHECK:      Name: foo
20# CHECK-NEXT: Value:
21# CHECK-NEXT: Size: 8
22# CHECK-NEXT: Binding: Global
23# CHECK-NEXT: Type: Object
24# CHECK-NEXT: Other:
25# CHECK-NEXT: Section: .bss.rel.ro
26
27.global _start
28_start:
29  .quad foo
30
31

served by {OpenGrok

Last Index Update: Fri May 15 20:09:11 GMT 2026