This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

mips: emit HI16 relocs on non-pic n32


The assembler emitted only the LO16 relocations when generating
non-PIC n32.  When initial NEWABI support was introduced, it went a
bit too far in disabling special-handling of _gp_disp, also removing
the HI16 relocation that should be emitted when loading a 32-bit
address into a register.

This patch fixes the problem.  Eric approved it in private, so I'm
checking it in.

Index: gas/ChangeLog
from  Alexandre Oliva  <aoliva@redhat.com>

	* config/tc-mips.c (macro_build_lui): _gp_disp is not special on
	NEWABI, but we should still emit HI16_S for non-PIC n32.

Index: gas/config/tc-mips.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-mips.c,v
retrieving revision 1.176
diff -u -p -r1.176 tc-mips.c
--- gas/config/tc-mips.c 5 Nov 2002 21:53:13 -0000 1.176
+++ gas/config/tc-mips.c 7 Nov 2002 01:59:50 -0000
@@ -3268,12 +3268,13 @@ macro_build_lui (place, counter, ep, reg
 				>> 16) & 0xffff;
       *r = BFD_RELOC_UNUSED;
     }
-  else if (! HAVE_NEWABI)
+  else
     {
       assert (ep->X_op == O_symbol);
       /* _gp_disp is a special case, used from s_cpload.  */
       assert (mips_pic == NO_PIC
-	      || strcmp (S_GET_NAME (ep->X_add_symbol), "_gp_disp") == 0);
+	      || (! HAVE_NEWABI
+		  && strcmp (S_GET_NAME (ep->X_add_symbol), "_gp_disp") == 0));
       *r = BFD_RELOC_HI16_S;
     }
 
-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                 aoliva@{redhat.com, gcc.gnu.org}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist                Professional serial bug killer

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]