Seva Alekseyev
Seva Alekseyev

Reputation: 61331

Code addresses in DWARF v1 should be relocated but aren't

I'm looking at an ELF file built for MIPS targeting (I think) PlayStation. It has DWARFv1 debug info. The ELF type is ET_EXEC. There are two segments defined in the program header table, with p_vaddr values 0x100000 (RWX) and 0x440000 (RW), respectively. Meanwhile in DWARF, I see code addresses that look like they are relative to 0 - the lowermost function goes from 0x2D to 0x33, etc.

The DWARF info is in the .debug section, as the DWARFv1 convention was.

Normally, I'd expect relocations of the DWARF section to adjust those. However, there is no section called .rel.debug. The only REL-type section in the file is .relmain and its sh_info points at another section called main.

What am I missing? The DWARFv1.1 standard section 4.4 says the attributes of type addr are "relocated", as follows:

This address is relocatable in a relocatable object file and is relocated in an executable file or shared object.

Is there another place where relocation entries for the debug section are?

Upvotes: 0

Views: 18

Answers (0)

Related Questions