|
16 | 16 | // RUN: llvm-objdump --syms %t-shlib.so | FileCheck %s --check-prefix SHLIB-DUMP |
17 | 17 | // SHLIB-DUMP: 0000000000010380 g F .text 000000{{[0-9a-f]+}} use_callback |
18 | 18 |
|
19 | | - |
20 | | -// Should not build with the --building-freebsd-rtld flag |
21 | 19 | // Check that we emit a R_CHERI_CAPABILITY relocation instead of __cap_relocs for shlib/pie/dynamically linked exe |
22 | 20 | // RUN: ld.lld -shared %t.o %t-shlib.so -o %t.so --verbose-cap-relocs 2>&1 | FileCheck %s -check-prefixes VERBOSE-MSG |
23 | 21 | // RUN: llvm-readobj --dyn-symbols --dyn-relocations --cap-relocs --cap-table %t.so | FileCheck %s --check-prefixes CHECK,CHECK-SHLIB |
|
129 | 127 | // STATIC-NEXT: 0x20 global_return2@CAPTABLE |
130 | 128 | // STATIC-NEXT: ] |
131 | 129 |
|
132 | | -// Should not build as RTLD (due to the R_CHERI_CAPABILITY relocation) |
133 | | -// RUN: not ld.lld -Bsymbolic -shared --building-freebsd-rtld %t.o %t-shlib.o --verbose-cap-relocs -o /dev/null 2>&1 | FileCheck %s -check-prefix RTLD-ERROR |
134 | | -// RTLD-ERROR: Using trampoline for function pointer against local function return1 |
135 | | -// RTLD-ERROR-NEXT: >>> defined in ({{.+}}local-fn-ptr-in-plt-abi.c.tmp.o:(function return1{{.+}})) |
136 | | -// RTLD-ERROR-NEXT: ld.lld: error: relocation R_MIPS_CHERI_CAPABILITY against local function return1 |
137 | | -// RTLD-ERROR-NEXT: >>> defined in ({{.+}}local-fn-ptr-in-plt-abi.c.tmp.o:(function return1{{.+}})) cannot be using when building FreeBSD RTLD |
138 | | -// RTLD-ERROR-NEXT: >>> referenced by [email protected] |
139 | | -// RTLD-ERROR-NEXT: >>> first used in function __start |
140 | | -// RTLD-ERROR-NEXT: >>> defined in ({{.+}}local-fn-ptr-in-plt-abi.c.tmp.o:(function __start{{.+}})) |
141 | | - |
142 | | -// RTLD-ERROR-NEXT: Using trampoline for function pointer against function global_return2 |
143 | | -// RTLD-ERROR-NEXT: >>> defined in ({{.+}}local-fn-ptr-in-plt-abi.c.tmp.o:(function global_return2{{.+}})) |
144 | | -// RTLD-ERROR-EMPTY: |
145 | | -// RTLD-ERROR-NEXT: ld.lld: error: relocation R_MIPS_CHERI_CAPABILITY against function global_return2 |
146 | | -// RTLD-ERROR-NEXT: >>> defined in ({{.+}}local-fn-ptr-in-plt-abi.c.tmp.o:(function global_return2{{.+}})) cannot be using when building FreeBSD RTLD |
147 | | -// RTLD-ERROR-NEXT: >>> referenced by global_return2@CAPTABLE |
148 | | -// RTLD-ERROR-NEXT: >>> first used in function __start |
149 | | -// RTLD-ERROR-NEXT: >>> defined in ({{.+}}local-fn-ptr-in-plt-abi.c.tmp.o:(function __start{{.+}})) |
150 | | -// RTLD-ERROR-EMPTY: |
151 | | - |
152 | 130 | // Check that we don't crash when a version script marks a symbol as non-preemptible: |
153 | 131 | // RUN: echo "VERSION_1.0 { local: *; };" > %t.script |
154 | 132 | // RUN: ld.lld -shared %t.o %t-shlib.so --verbose-cap-relocs -o %t-version-script.so --version-script %t.script |
|
0 commit comments