From: Petr Machata Date: Fri, 13 Feb 2009 14:35:33 +0000 (+0100) Subject: Consider relocations below ELF_T_HALF and DW_FORM_data2 illegal X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=63c7e48ed2b81a1f6ee7d49c6feb5b7709284cb4;p=thirdparty%2Felfutils.git Consider relocations below ELF_T_HALF and DW_FORM_data2 illegal --- diff --git a/src/dwarflint.c b/src/dwarflint.c index 1c8f5622b..68b4358c6 100644 --- a/src/dwarflint.c +++ b/src/dwarflint.c @@ -2461,6 +2461,11 @@ reloc_target (uint8_t form, struct abbrev_attrib *at) case DW_FORM_data1: case DW_FORM_data2: + /* While these are technically legal, they are never used in + DWARF sections. So better mark them as illegal, and have + dwarflint flag them. */ + return sec_invalid; + case DW_FORM_data4: case DW_FORM_data8: @@ -4108,14 +4113,17 @@ check_relocation_section_structural (Dwarf *dwarf, switch (type) { - case ELF_T_BYTE: - case ELF_T_HALF: case ELF_T_WORD: case ELF_T_SWORD: case ELF_T_XWORD: case ELF_T_SXWORD: break; + case ELF_T_BYTE: + case ELF_T_HALF: + /* Technically legal, but never used. Better have dwarflint + flag them as erroneous, because it's more likely these + are a result of a bug than actually being used. */ default: wr_error (&where, ": invalid relocation type %d.\n", type); retval = false;