aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog9
-rw-r--r--ld/emultempl/mipself.em12
-rw-r--r--ld/testsuite/ld-mips-elf/pr21334.dd2
-rw-r--r--ld/testsuite/ld-mips-elf/pr21334.s2
4 files changed, 22 insertions, 3 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 528ba3c..f4f1d2e 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,4 +1,13 @@
2018-09-14 Maciej W. Rozycki <macro@mips.com>
+
+ PR ld/21375
+ * emultempl/mipself.em: Set `gnu_target' according to ${target}.
+ (mips_create_output_section_statements): Update call to
+ `_bfd_mips_elf_linker_flags'.
+ * testsuite/ld-mips-elf/pr21334.s: Use LWL rather than LW.
+ * testsuite/ld-mips-elf/pr21334.dd: Update accordingly.
+
+2018-09-14 Maciej W. Rozycki <macro@mips.com>
Maciej W. Rozycki <macro@linux-mips.org>
* ldexp.c (fold_binary): Always make the result of SEGMENT_START
diff --git a/ld/emultempl/mipself.em b/ld/emultempl/mipself.em
index c7c1642..ec8a086c 100644
--- a/ld/emultempl/mipself.em
+++ b/ld/emultempl/mipself.em
@@ -18,6 +18,15 @@
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
# MA 02110-1301, USA.
+case ${target} in
+ *-*-*gnu*)
+ gnu_target=TRUE
+ ;;
+ *)
+ gnu_target=FALSE
+ ;;
+esac
+
fragment <<EOF
#include "ldctor.h"
@@ -203,7 +212,8 @@ mips_create_output_section_statements (void)
htab = elf_hash_table (&link_info);
if (is_elf_hash_table (htab) && is_mips_elf (link_info.output_bfd))
- _bfd_mips_elf_linker_flags (&link_info, insn32, ignore_branch_isa);
+ _bfd_mips_elf_linker_flags (&link_info, insn32, ignore_branch_isa,
+ ${gnu_target});
if (is_mips_elf (link_info.output_bfd))
_bfd_mips_elf_init_stubs (&link_info, mips_add_stub_section);
diff --git a/ld/testsuite/ld-mips-elf/pr21334.dd b/ld/testsuite/ld-mips-elf/pr21334.dd
index 01c3718..60f0553 100644
--- a/ld/testsuite/ld-mips-elf/pr21334.dd
+++ b/ld/testsuite/ld-mips-elf/pr21334.dd
@@ -4,7 +4,7 @@ Disassembly of section \.text:
[0-9a-f]+ <[^>]*> lui gp,0x1
[0-9a-f]+ <[^>]*> addiu gp,gp,-32736
[0-9a-f]+ <[^>]*> addu gp,gp,t9
-[0-9a-f]+ <[^>]*> lw v0,-32744\(gp\)
+[0-9a-f]+ <[^>]*> lwl v0,-32744\(gp\)
[0-9a-f]+ <[^>]*> jr ra
[0-9a-f]+ <[^>]*> addiu v0,v0,4
\.\.\.
diff --git a/ld/testsuite/ld-mips-elf/pr21334.s b/ld/testsuite/ld-mips-elf/pr21334.s
index d62c18c..7f26318 100644
--- a/ld/testsuite/ld-mips-elf/pr21334.s
+++ b/ld/testsuite/ld-mips-elf/pr21334.s
@@ -8,7 +8,7 @@ foo:
.mask 0x00000000, 0
.fmask 0x00000000, 0
.cpload $25
- lw $2, %got(bar)($28)
+ lwl $2, %got(bar)($28)
jr $31
addiu $2, $2, 4
.end foo