-
Notifications
You must be signed in to change notification settings - Fork 511
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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>
- Loading branch information
Showing
9 changed files
with
222 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* This source was compiled for LoongArch64. | ||
loongarch64-unknown-linux-gnu-gcc -c -o loongarch64-relocs.o.elf loongarch-relocs.c -g | ||
Upstream support for LoongArch32 is not yet mature, so it is not covered. | ||
*/ | ||
|
||
extern struct { | ||
int i, j; | ||
} data; | ||
|
||
extern int bar (void); | ||
|
||
int | ||
foo (int a) | ||
{ | ||
data.i += a; | ||
data.j -= bar(); | ||
return 0; | ||
} |
Binary file not shown.