LoongArch: gas: Fix shared builds
authorWANG Xuerui <git@xen0n.name>
Sun, 2 Jul 2023 10:14:22 +0000 (18:14 +0800)
committerliuzhensong <liuzhensong@loongson.cn>
Mon, 3 Jul 2023 01:00:33 +0000 (09:00 +0800)
Formerly an include of libbfd.h was added in commit 56576f4a722
("LoongArch: gas: Add support for linker relaxation."), in order to
allow calling _bfd_read_unsigned_leb128 from gas, but doing so broke
shared builds. Commit d2fddb6d783 fixed this reference but did not
remove the now unnecessary inclusion of libbfd.h. The gas_assert macro
expands into a conditional call to abort(), but "abort" is re-defined to
_bfd_abort in libbfd.h, so the extra include breaks any gas_assert
usage, and should be removed.

gas/ChangeLog:

* config/tc-loongarch.c: Don't include libbfd.h.

Fixes: d2fddb6d783 ("LoongArch: Fix ld "undefined reference" error with --enable-shared")
Signed-off-by: WANG Xuerui <git@xen0n.name>
gas/config/tc-loongarch.c

index 439bde18b7dd8c0cc35d4bf7fa8a5b4e72d8aa42..2e8a259d1479a8a6cb97fd2c3bf092542ad00eae 100644 (file)
@@ -31,7 +31,6 @@
 #include <string.h>
 #include <stdio.h>
 #include <assert.h>
-#include "libbfd.h"
 
 /* All information about an instruction during assemble.  */
 struct loongarch_cl_insn