diff options
author | mengqinggang <mengqinggang@loongson.cn> | 2024-06-28 14:24:19 +0800 |
---|---|---|
committer | liuzhensong <liuzhensong@loongson.cn> | 2024-08-05 17:38:49 +0800 |
commit | 3a83f0342e545a638aba06f27bba76938ef251ab (patch) | |
tree | 3294c44e3e3c412d5521271ab5893f88eb83e009 /bfd | |
parent | 0c817e7c1058de7efbb47f253d7df9278587dead (diff) | |
download | binutils-3a83f0342e545a638aba06f27bba76938ef251ab.zip binutils-3a83f0342e545a638aba06f27bba76938ef251ab.tar.gz binutils-3a83f0342e545a638aba06f27bba76938ef251ab.tar.bz2 |
LoongArch: Add support for OUTPUT_FORMAT("binary")
In binary output format, loongarch_elf_hash_table return NULL and result
in segment fault.
When ld output binary file, it seems that elf related functions should
not be called. But loongarch_elf_relax_section be called and
loongarch_elf_hash_table cause segment fault.
Just redefined loongarch_elf_hash_table and always return
link_info->hash.
The tests of binutils, glibc and gcc is ok.
0 loongarch_elf_relax_section ()
1 0x000055555557ab28 in lang_size_sections_1 ()
2 0x000055555557a16c in lang_size_sections_1 ()
3 0x000055555557b0a8 in one_lang_size_sections_pass ()
4 0x000055555557b478 in lang_size_sections ()
5 0x000055555557e65c in lang_relax_sections ()
6 0x000055555559f9c8 in ldelf_map_segments ()
7 0x000055555559783c in gldelf64loongarch_after_allocation ()
8 0x000055555558dac0 in ldemul_after_allocation ()
9 0x000055555557f6c0 in lang_process ()
10 0x0000555555585314 in main ()
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/elfnn-loongarch.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/bfd/elfnn-loongarch.c b/bfd/elfnn-loongarch.c index db6d419..71fa8fa 100644 --- a/bfd/elfnn-loongarch.c +++ b/bfd/elfnn-loongarch.c @@ -157,9 +157,7 @@ loongarch_elf_new_section_hook (bfd *abfd, asection *sec) /* Get the LoongArch ELF linker hash table from a link_info structure. */ #define loongarch_elf_hash_table(p) \ - (elf_hash_table_id (elf_hash_table (p)) == LARCH_ELF_DATA \ - ? ((struct loongarch_elf_link_hash_table *) ((p)->hash)) \ - : NULL) + ((struct loongarch_elf_link_hash_table *) ((p)->hash)) \ #define MINUS_ONE ((bfd_vma) 0 - 1) |