Fix the LoongArch support code and some more (#483)
* Fix LoongArch support in dwarfdump.py
The e_machine constant is EM_LOONGARCH, and the emulation name is just
elf{32,64}-loongarch without the endian prefix.
Fixes: 6c36d79 ("add support for loongarch64 to dwarfdump (#458)")
Signed-off-by: WANG Xuerui <xen0n@gentoo.org>
* Fix the EF_LOONGARCH_* symbol names
The current code gets the logic right, but not the symbol names. Fix
them for consistency with the canonical definition that's binutils.
Fixes: 2059475 ("Add support for LoongArch (#470)")
Signed-off-by: WANG Xuerui <xen0n@gentoo.org>
* Fix a missing description string in elffile.py for LoongArch
Fixes: 2059475 ("Add support for LoongArch (#470)")
Signed-off-by: WANG Xuerui <xen0n@gentoo.org>
* Provide EF_LARCH_* name aliases for the EF_LOONGARCH_* constants
Signed-off-by: WANG Xuerui <xen0n@gentoo.org>
* Add definitions for LoongArch relocations
Signed-off-by: WANG Xuerui <xen0n@gentoo.org>
* Add support for basic 32- and 64-bit LoongArch relocations
Signed-off-by: WANG Xuerui <xen0n@gentoo.org>
* scripts/readelf.py: Properly format control chars in symbol names
This is necessary to match readelf behavior on fake symbol names, that
usually look like "L0^A" when rendered (being "L0\x01" in reality).
Signed-off-by: WANG Xuerui <xen0n@gentoo.org>
* scripts/readelf.py: Fix register display order in _dump_debug_frames_interp
According to binutils sources (function frame_display_row in
binutils/dwarf.c), the apparent ordering of the ra register after other
registers is merely a side effect of most architectures allocating a
larger DWARF register number for their respective ra registers. This has
no effect on all readelf test cases, but is necessary for a future
LoongArch test binary to pass comparisons.
Signed-off-by: WANG Xuerui <xen0n@gentoo.org>
* Add test program and artifact covering basic LoongArch relocations
Signed-off-by: WANG Xuerui <xen0n@gentoo.org>
---------
Signed-off-by: WANG Xuerui <xen0n@gentoo.org>