From 63c7e48ed2b81a1f6ee7d49c6feb5b7709284cb4 Mon Sep 17 00:00:00 2001 From: Petr Machata Date: Fri, 13 Feb 2009 15:35:33 +0100 Subject: [PATCH] Consider relocations below ELF_T_HALF and DW_FORM_data2 illegal --- src/dwarflint.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) 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; -- 2.47.3