[PATCH v2 4/4] Gold/MIPS: Add MIPS64 support for --eanble-targets option
YunQiang Su
yunqiang.su@cipunited.com
Sun Aug 20 14:58:38 GMT 2023
Currently, if we pass only mips64 triples to --eanble-targets,
gold itself will link fail:
/usr/bin/ld: /usr/bin/ld: mips.o: in function `gold::Output_reloc<9, true, 32, true>::sort_before(gold::Output_reloc<9, true, 32, true> const&) const':
./builddir-mips/gold/../../gold/output.h:1276:(.text+0x2b44): undefined reference to `gold::Output_reloc<9, true, 32, true>::compare(gold::Output_reloc<9, true, 32, true> const&) const'
/usr/bin/ld: mips.o: in function `gold::Output_reloc<9, true, 32, false>::sort_before(gold::Output_reloc<9, true, 32, false> const&) const':
./builddir-mips/gold/../../gold/output.h:1276:(.text+0x2bb4): undefined reference to `gold::Output_reloc<9, true, 32, false>::compare(gold::Output_reloc<9, true, 32, false> const&) const'
/usr/bin/ld: mips.o: in function `gold::Output_reloc<9, true, 32, true>::sort_before(gold::Output_reloc<9, true, 32, true> const&) const':
./builddir-mips/gold/../../gold/output.h:1276:(.text+0x2d28): undefined reference to `gold::Output_reloc<9, true, 32, true>::compare(gold::Output_reloc<9, true, 32, true> const&) const'
/usr/bin/ld: mips.o: in function `gold::Output_reloc<9, true, 32, false>::sort_before(gold::Output_reloc<9, true, 32, false> const&) const':
./builddir-mips/gold/../../gold/output.h:1276:(.text+0x2df8): undefined reference to `gold::Output_reloc<9, true, 32, false>::compare(gold::Output_reloc<9, true, 32, false> const&) const'
Here, we add:
mips64*el-*-* | mipsisa64*el-linux* for MIPS64 little endian;
mips64*-*-* | mipsisa64*-linux* for MIPS64 big endian.
---
gold/configure.tgt | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/gold/configure.tgt b/gold/configure.tgt
index 03e33f32baf..1e6dc18d4b6 100644
--- a/gold/configure.tgt
+++ b/gold/configure.tgt
@@ -153,6 +153,13 @@ aarch64*-*)
targ_big_endian=false
targ_extra_big_endian=true
;;
+mips64*el-*-* | mipsisa64*el-linux*)
+ targ_obj=mips
+ targ_machine=EM_MIPS
+ targ_size=64
+ targ_big_endian=false
+ targ_extra_big_endian=true
+ ;;
mips*el-*-*)
targ_obj=mips
targ_machine=EM_MIPS
@@ -160,6 +167,13 @@ mips*el-*-*)
targ_big_endian=false
targ_extra_big_endian=true
;;
+mips64*-*-* | mipsisa64*-linux*)
+ targ_obj=mips
+ targ_machine=EM_MIPS
+ targ_size=64
+ targ_big_endian=true
+ targ_extra_big_endian=false
+ ;;
mips*-*-*)
targ_obj=mips
targ_machine=EM_MIPS
--
2.30.2
More information about the Binutils
mailing list