Windows on ARM is always thumb, and contrary to ELF, there's no per-symbol flag to indicate arm vs thumb mode. Therefore, the linkers both Microsoft's link.exe and lld) sets the thumb bit in all relocations pointing to code sections.
In ELF, the thumb bit is only set for symbols marked as %function, that is, it isn't set in local labels used when constructing the dwarf debug info and line tables.
As the windows linkers sets the thumb bit in all code addresses, we'd have to cope with this and strip out the lowest bit from all code addresses if the architecture is ARM/Thumb.
The testcase uses a prelinked .yaml source instead of an assembly source file, to avoid needing to run a linker as part of the test.
There's already predecent for this in DWARFCallFrameInfo::GetFDEIndex, this extends the same concept to DWARF debug info and line tables. I'm not sure if I managed to get all spots covered here, but I tried to look for all cases of DW_AT_low_pc/DW_AT_high_pc and find the best place to handle it, where it would have to be handled in as few places as possible.
This is admittedly not very pretty, improvement suggestions are welcome.
Finally, this makes sure to propagate the correct address byte size to DataExtractors that are taken from e.g. ObjectFile::ReadSectionData. Previously, the DataExtractor got the host address size set, which later tripped up DWARFDebugLine::LineTable::parse as the address size of the line table (4) mismatched the one set in the DWARFDataExtractor (which was propagated from ObjectFile's internal m_data, which never got anything else set than the default from the host's sizeof(void*)).
This caused line tables to end up missing if inspecting a foreign object file (like in the testcase).