From: Joseph K. <jk...@us...> - 2021-05-04 18:39:11
|
m.f> Alternatively, an arguably better check is to make sure the Elf_Data m.f> has d_type == ELF_T_REL(A). What are your thoughts on that? The suggested change looks cleaner at the first glance, but is also a change that could break existing code. This is because elf_newdata(3) initializes the 'd_type' field of the returned Elf_Data descriptor to 'ELF_T_BYTE'. Applications do need to override this value eventually, but can currently do so any time before the call to elf_update(3). With this change applications would need to set 'd_type' before calling the gelf_update_rel{,a}() APIs, which is a new behavioral requirement. -- Joseph Koshy | Volunteer Developer, The Elftoolchain Project |