PR32870: ld: arm32: fix segfault when linking with LLVMgold.so plugin under LTO
Checks
Context |
Check |
Description |
linaro-tcwg-bot/tcwg_binutils_build--master-arm |
success
|
Build passed
|
linaro-tcwg-bot/tcwg_binutils_check--master-arm |
success
|
Test passed
|
linaro-tcwg-bot/tcwg_binutils_build--master-aarch64 |
success
|
Build passed
|
linaro-tcwg-bot/tcwg_binutils_check--master-aarch64 |
success
|
Test passed
|
Commit Message
Hi,
Proposed patch to PR32870.
When handling the iplt in ARM32, the ld must check whether the input_bfd
is in ELF format. If the input is an LLVM Bitcode file, an error will be raised.
Any suggestions? Thanks.
---
PR 32870
* elf32-arm.c (elf32_arm_output_arch_local_syms): Check input_bfd
@@ -18345,6 +18345,9 @@ elf32_arm_output_arch_local_syms (bfd *output_bfd,
struct arm_local_iplt_info **local_iplt;
unsigned int i, num_syms;
+ if (!is_arm_elf (input_bfd))
+ continue;
+
local_iplt = elf32_arm_local_iplt (input_bfd);
if (local_iplt != NULL)
{