This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
mips relocatable links
- From: Nathan Sidwell <nathan at codesourcery dot com>
- To: binutils <binutils at sources dot redhat dot com>
- Date: Mon, 09 Feb 2009 14:53:48 +0000
- Subject: mips relocatable links
I encountered a problem with relocatable linking on mips. For 32bit targets an
offset of 0x4000 is being added. I noticed that 64bit targets have this
addition commented out.
This patch makes 32bit behave the same as 64bit, ok?
nathan
--
Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery
2009-02-09 Nathan Sidwell <nathan@codesourcery.com>
* elf32-mips.c (mips_elf_final_gp): Don't add 0x4000 offset for
relocatable link.
Index: elf32-mips.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-mips.c,v
retrieving revision 1.202
diff -c -3 -p -r1.202 elf32-mips.c
*** elf32-mips.c 8 Aug 2008 19:24:48 -0000 1.202
--- elf32-mips.c 9 Feb 2009 14:51:05 -0000
*************** mips_elf_final_gp (bfd *output_bfd, asym
*** 1005,1011 ****
if (relocatable)
{
/* Make up a value. */
! *pgp = symbol->section->output_section->vma + 0x4000;
_bfd_set_gp_value (output_bfd, *pgp);
}
else if (!mips_elf_assign_gp (output_bfd, pgp))
--- 1005,1011 ----
if (relocatable)
{
/* Make up a value. */
! *pgp = symbol->section->output_section->vma /*+ 0x4000*/;
_bfd_set_gp_value (output_bfd, *pgp);
}
else if (!mips_elf_assign_gp (output_bfd, pgp))