Why does ELF/alpha put none-text relocations in .rela.text?

H . J . Lu hjl@lucon.org
Mon Aug 20 16:05:00 GMT 2001


On Mon, Aug 20, 2001 at 03:03:28PM -0700, Richard Henderson wrote:
> On Mon, Aug 20, 2001 at 11:44:19AM -0700, H . J . Lu wrote:
> >  00000000  200569c000000006 R_ALPHA_GPDISP        bad symbol index: 200569c0
> > 
> > How should we fix it?
> 
> The symbol for GPDISP is completely irrelevant.  Only the offset
> is meaningful.  Use the current section symbol rather than a
> random section symbol.
> 

But we are using a random section symbol since we never reset now_seg.
This patch seems to work for me. Alan, do you have any comments?

Thanks.


H.J.
----
2001-08-20  H.J. Lu  <hjl@gnu.org>

	* write.c (write_relocs): Reset the current section.

Index: write.c
===================================================================
RCS file: /work/cvs/gnu/binutils/gas/write.c,v
retrieving revision 1.26
diff -u -p -r1.26 write.c
--- write.c	2001/08/03 15:55:50	1.26
+++ write.c	2001/08/20 23:00:50
@@ -958,6 +958,8 @@ write_relocs (abfd, sec, xxx)
   if (seginfo == NULL)
     return;
 
+  subseg_change (sec, 0);
+
   fixup_segment (seginfo->fix_root, sec);
 
   n = 0;



More information about the Binutils mailing list