diff --git a/src/ld_so/dso.rs b/src/ld_so/dso.rs index 8d0440478b..7a682c5d02 100644 --- a/src/ld_so/dso.rs +++ b/src/ld_so/dso.rs @@ -9,7 +9,6 @@ use object::{ Dyn as _, GnuHashTable, HashTable as SysVHashTable, ProgramHeader as _, Rel as _, Rela as _, Sym as _, Version, VersionTable, }, - ReadError, }, }; @@ -1130,10 +1129,14 @@ impl DSO { self.do_tlsdesc_reloc(reloc, ptr.cast::(), global_scope) } _ => { - None::<()>.read_error(concat!( + // object's ReadError/Error are private in the pinned object rev, + // so object::Error cannot be constructed here. An unsupported + // relocation type means this DSO cannot be loaded by this relibc + // build — a fatal, unrecoverable condition, so abort with it. + panic!(concat!( "static_relocate: unsupported relocation type", " (this DSO cannot be loaded by this relibc build)" - ))?; + )); } } @@ -1208,11 +1211,11 @@ impl DSO { } _ => { - None::<()>.read_error(concat!( + panic!(concat!( "lazy_relocate: unsupported relocation type with \ non-Lazy resolve (DSO cannot be loaded by this \ relibc build)" - ))?; + )); } } }