if (file->ehdr.e_type == ET_REL
&& ELF64_ST_TYPE (symbol->st_info) == STT_SECTION)
{
- assert (sym_value == 0);
+ if (sym_value != 0)
+ wr_warning (reloc_where)
+ << "relocation formed using STT_SECTION symbol with non-zero value."
+ << std::endl;
+
require_valid_section_index;
sym_value = file->sec[section_index].shdr.sh_addr;
}
{
if (offset_into != rel_address && section_index == SHN_UNDEF)
wr_error (&reloc_where,
- ": relocation of an address is formed against SHN_UNDEF symbol"
+ ": relocation of an address is formed using SHN_UNDEF symbol"
" (symtab index %d).\n", rel->symndx);
else
{
testfiles hello.bad-1 hello.bad-3 empty-1 \
garbage-1 garbage-2 garbage-3 garbage-4 \
garbage-5 garbage-6 garbage-7 garbage-8 \
- garbage-9
+ garbage-9 garbage-10
testrun_compare ./dwarflint hello.bad-1 <<EOF
error: .debug_info: DIE 0x83: abbrev section at 0x0 doesn't contain code 83.
error: .debug_info: DIE 0x6c: is the last sibling in chain, but has a DW_AT_sibling attribute.
error: .debug_info: DIE 0xab (abbreviation 113): DIE chain not terminated with null entry.
EOF
+
+testrun_compare ./dwarflint garbage-10 <<EOF
+warning: .rela.debug_info: offset 0xc: relocation formed using STT_SECTION symbol with non-zero value.
+error: .rela.debug_info: offset 0x11: couldn't obtain symbol #7208969: invalid section index.
+EOF