From: Michael F. <mf...@mf...> - 2021-04-29 20:38:05
|
Hi, I'm looking for some advice for an issue I hit with some recent changes to Linux objtool. Since [0], objtool calls gelf_update_rel[a] to write relocations to newly created sections rather than writing to a raw array of GElf_Rel itself. However, the section header is not updated until later when the ELF file is written back to disk. It appears that elftoolchain has a check[1] in gelf_update_rel[a] to make sure that the section header corresponding to the GElf_Data has the appropriate type, and it fails if not. Is this a bug in objtool using the libelf API incorrectly, or is elftoolchain being a bit too eager in its checks? Perhaps it could skip the check if sh_type == SHT_NULL? Thanks for any help! [0] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=a1a664ece586457e9f7652b0bc5b08386259e358 [1] https://sourceforge.net/p/elftoolchain/code/HEAD/tree/trunk/libelf/gelf_rela.c#l69 |