Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 25 Apr 1997 11:23:07 +0100 (BST)
From:      Doug Rabson <dfr@nlsystems.com>
To:        jdp@freebsd.org
Cc:        current@freebsd.org
Subject:   Minor fix to ld
Message-ID:  <Pine.BSF.3.95q.970425111515.16521A-100000@herring.nlsystems.com>

next in thread | raw e-mail | index | archive | help
While I was writing my new kernel linker, I noticed that the
relocation_info structures for the members of linker sets had r_length set
to zero (indicating byte sized relocations) when the objects being
relocated were 32bit.  The code in ld.so has a hack (see the definition of
REL_SIZE in ld/i386/md.c) to work around this.  It would be nice to have
correct relocations though and I think this patch does the job:

Index: md.h
===================================================================
RCS file: /home/ncvs/src/gnu/usr.bin/ld/i386/md.h,v
retrieving revision 1.16
diff -u -r1.16 md.h
--- md.h	1997/02/22 15:46:34	1.16
+++ md.h	1997/04/25 10:11:12
@@ -95,6 +95,8 @@
 
 #define md_get_rt_segment_addend(r,a)	md_get_addend(r,a)
 
+#define RELOC_INIT_SEGMENT_RELOC(r)	((r)->r_length = 2)
+
 /* Width of a Global Offset Table entry */
 #define GOT_ENTRY_SIZE	4
 typedef long	got_t;


--
Doug Rabson				Mail:  dfr@nlsystems.com
Nonlinear Systems Ltd.			Phone: +44 181 951 1891




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.95q.970425111515.16521A-100000>