Skip to content

Commit 1885920

Browse files
jrtc27resistor
authored andcommitted
[ELF][CHERI] Delete an obsolete check
This dates back to 2021; such object files are long past their support window.
1 parent 4f6a35a commit 1885920

File tree

3 files changed

+25
-203
lines changed

3 files changed

+25
-203
lines changed

lld/ELF/Arch/Cheri.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -905,16 +905,6 @@ void addCapabilityRelocation(
905905
RelocationBaseSection *dynRelSec) {
906906
Symbol *sym = dyn_cast<Symbol *>(symOrSec);
907907
assert(expr == R_CHERI_CAPABILITY);
908-
if (sec->name == ".gcc_except_table" && sym && sym->isPreemptible) {
909-
// We previously had an ugly workaround here to create a hidden alias for
910-
// relocations in the exception table, but this has since been fixed in
911-
// the compiler. Add an explicit error here in case someone tries to
912-
// link against object files/static libraries from an old toolchain.
913-
auto diag = ctx.arg.noinhibitExec ? Warn(ctx) : Err(ctx);
914-
diag << "got relocation against preemptible symbol " << toStr(ctx, *sym)
915-
<< " in exception handling table. Please recompile this file!\n"
916-
<< ">>> referenced by " << sec->getObjMsg(offset);
917-
}
918908

919909
bool needTrampoline = false;
920910
// In the PLT ABI (and fndesc?) we have to use an elf relocation for function

lld/test/ELF/cheri/function-with-offset-reloc.s

Lines changed: 0 additions & 193 deletions
This file was deleted.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# REQUIRES: riscv
2+
# RUN: %riscv64_cheri_purecap_llvm-mc -filetype=obj %s -o %t.o
3+
# RUN: ld.lld -shared %t.o -o %t.so 2>&1 | FileCheck --implicit-check-not=warning: %s
4+
5+
.type local, @function
6+
local:
7+
cret
8+
.size local, . - local
9+
10+
.type global, @function
11+
.global global
12+
global:
13+
cret
14+
.size global, . - global
15+
16+
.type undef, @function
17+
.global undef
18+
19+
.data
20+
foo:
21+
.chericap local + 1
22+
# CHECK: warning: got capability relocation with non-zero addend (0x1) against function global. This may not be supported by the runtime linker.
23+
.chericap global + 1
24+
# CHECK: warning: got capability relocation with non-zero addend (0x1) against function undef. This may not be supported by the runtime linker.
25+
.chericap undef + 1

0 commit comments

Comments
 (0)