This adds the support for SHT_ARM_EXIDX sections to obj2yaml/yaml2obj tools.
SHT_ARM_EXIDX is a ARM specific index table filled with entries.
Each entry consists of two 4-bytes values (words).
(https://developer.arm.com/documentation/ihi0038/c/?lang=en#index-table-entries)
Note: I am not sure if we should respect endianness for these words.
This patch does. But seems everywhere in LLVM they are written/read as LE.
At the same time GNU readelf -u behaves differently for a section that is described as:
- Name: .ARM.exidx Type: SHT_ARM_EXIDX Content: "00000000000000010000000001000000"
For a little endian object it dumps:
> readelf -u test.o Unwind section '.ARM.exidx' at offset 0x40 contains 1 entry: 0x0: @0x1000004 readelf: Warning: Could not locate .ARM.extab section containing 0x1000004. 0x8: 0x1 [cantunwind]
And for a big endian:
> readelf -u test.o Unwind section '.ARM.exidx' at offset 0x40 contains 1 entry: 0x0: 0x1 [cantunwind] 0x8: @0x100000c readelf: Warning: Could not locate .ARM.extab section containing 0x100000c.
I also haven't found in specification that these values must always be little-endian.
I think you should drop the EM_ARM requirement here. It doesn't really add anything, and makes it more restrictive on what one can use this code for. Imagine I have a downstream target that is ARM-based - I might have a different EM_* value, but still want to be able to use SHT_ARM_EXIDX, and therefore I'd want to be able to write tests using this format.