On Fri, 17 Apr 2009 21:42:22 +0200, Roland McGrath wrote:
So, the "more than complete enough" checking plan (i.e.
where you bother
with reloc checks in non-ET_REL at all) would be as follows. For a reloc
in an SHT_REL (not SHT_RELA) section in a non-ET_REL file, subtract the
symbol value (and barf if it's SHN_UNDEF)--note that since it's an ET_REL,
the st_value is the final value directly, not section-relative. If there
is an SHT_REL,SHF_ALLOC section that applies to the section you are
checking, complain and punt (however you would if all its relocs were
unknown types or whatnot). (If the SHT_REL,SHF_ALLOC section has a target
section that is not SHF_ALLOC, elflint should complain about that.)
FYI there was a GDB discussion about ET_EXEC relocations (in vmlinux),
Alan Modra's advice from it:
But IIUC the checking vs. relocating operations are orthogonal here.