diff --git a/repos/base/src/lib/ldso/include/relocation_generic.h b/repos/base/src/lib/ldso/include/relocation_generic.h index 4ba6a707bf..f19cd4e840 100644 --- a/repos/base/src/lib/ldso/include/relocation_generic.h +++ b/repos/base/src/lib/ldso/include/relocation_generic.h @@ -16,6 +16,9 @@ #include +/* the R__NONE relocation is 0 for all supported architectures */ +static constexpr int R_NONE = 0; + constexpr bool verbose_relocation = false; static inline bool verbose_reloc(Linker::Dependency const &d) @@ -66,7 +69,9 @@ struct Linker::Reloc_plt_generic Elf::Rel const *start, unsigned long size) { if (type != TYPE) { - error("LD: Unsupported PLT relocation type: ", (int)type); + error("LD: Unsupported translation table address format.", + " Expected ", TYPE, " got ", unsigned(type), ".", + " Type can only be DT_REL or DT_RELA not both."); throw Incompatible(); } @@ -74,6 +79,9 @@ struct Linker::Reloc_plt_generic REL const *end = rel + (size / sizeof(REL)); for (; rel < end; rel++) { + /* do nothing */ + if (rel->type() == R_NONE) continue; + if (rel->type() != JMPSLOT) { error("LD: Unsupported PLT relocation ", (int)rel->type()); throw Incompatible();