This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
[patch] MIPS: Use the right offset for LO16 in add_got_offset_hilo()(ping)
- From: "Maciej W. Rozycki" <macro at linux-mips dot org>
- To: binutils at sources dot redhat dot com
- Date: Thu, 24 Feb 2005 20:06:36 +0000 (GMT)
- Subject: [patch] MIPS: Use the right offset for LO16 in add_got_offset_hilo()(ping)
Hello,
I've reviewed my pile of patches due to the close 2.16 branch and this
patch is still needed. OK to apply?
Maciej
---------- Forwarded message ----------
Message-ID: <Pine.LNX.4.55.0406281823190.23162@jurand.ds.pg.gda.pl>
Date: Mon, 28 Jun 2004 18:47:46 +0200 (CEST)
From: Maciej W. Rozycki <macro@linux-mips.org>
To: binutils@sources.redhat.com
Subject: [patch] MIPS: Use the right offset for LO16 in
add_got_offset_hilo()
Hello,
This is a follow-on patch to the "mips-hilo-reloc-sort" one. It changes
add_got_offset_hilo() to use the same addend for the LO16 relocation it
emits that is used for the preceding GOT16 one. It's required for the two
relocations to pair.
2004-06-28 Maciej W. Rozycki <macro@linux-mips.org>
* config/tc-mips.c (add_got_offset_hilo): Fix the addend used for
the LO16 reloc so that it pairs with thepreceding GOT16 one.
This has been tested for the mipsel-linux-gnu target with no new
regressions and fixing failures revealed by the "mips-hilo-reloc-sort"
patch in the "la-svr4pic", "lca-svr4pic" and "elf-rel19" test cases.
OK to apply?
Maciej
binutils-2.15.91-20040625-mips-reloc-got-offset.patch
diff -up --recursive --new-file binutils-2.15.91-20040625.macro/gas/config/tc-mips.c binutils-2.15.91-20040625/gas/config/tc-mips.c
--- binutils-2.15.91-20040625.macro/gas/config/tc-mips.c 2004-06-15 03:25:28.000000000 +0000
+++ binutils-2.15.91-20040625/gas/config/tc-mips.c 2004-06-28 00:15:46.000000000 +0000
@@ -4104,7 +4104,9 @@ add_got_offset_hilo (int dest, expressio
mips_optimize = 2;
macro_build_lui (&global, tmp);
mips_optimize = hold_mips_optimize;
+ local->X_add_number = ((local->X_add_number + 0x8000) & 0xffff) - 0x8000;
macro_build (local, ADDRESS_ADDI_INSN, "t,r,j", tmp, tmp, BFD_RELOC_LO16);
+ local->X_add_number = global.X_add_number;
relax_end ();
macro_build (NULL, ADDRESS_ADD_INSN, "d,v,t", dest, dest, tmp);