PATCH: Fix debug relocation for ia64

H. J. Lu hjl@lucon.org
Wed Jul 9 22:44:00 GMT 2003


On Wed, Jul 09, 2003 at 10:05:42AM -0700, H. J. Lu wrote:
> ld -r generates bogus debug info on ELF/ia64:
> 
> # make
> ld -z defs -shared -o a.so add_n.o adjtime.o
> adjtime.o(.text+0x142): In function `adjtime':
> ../sysdeps/unix/sysv/linux/adjtime.c:57: undefined reference to
> `__adjtimex_internal'
> adjtime.o(.text+0x382):../sysdeps/unix/sysv/linux/adjtime.c:57: undefined
> reference to `__GI___errno_location'
> make: [a.so] Error 1 (ignored)
> ld -r -o b.os add_n.o adjtime.o
> ld -z defs -shared -o b.so b.os
> b.os(.text+0x1e2)ld: Dwarf Error: DW_FORM_strp offset (7630441) greater than or
> equal to .debug_str size (17063).
> : In function `adjtime':
> : undefined reference to `__adjtimex_internal'
> b.os(.text+0x422): In function `adjtime':
> : undefined reference to `__GI___errno_location'
> make: [b.so] Error 1 (ignored)
> 
> 

It turned out that it was an ia64 bug. The problem is ia64 relocations
define src_mask and dst_mask to be 0. It is not a problem for normal
ia64 relocations since src_mask and dst_mask are not used. But
src_mask and dst_mask are used in bfd_perform_relocation to relocate
debug sections. I set them to -1LL. I think it should work with
relocations in debug sections for both LP64 and ILP32.


H.J.
-------------- next part --------------
2003-07-07  H.J. Lu <hongjiu.lu@intel.com>

	* elfxx-ia64.c (IA64_HOWTO): Set src_mask and dst_mask to -1LL.

--- bfd/elfxx-ia64.c.reloc	2003-07-09 08:12:27.000000000 -0700
+++ bfd/elfxx-ia64.c	2003-07-09 15:24:52.000000000 -0700
@@ -368,7 +368,7 @@ elfNN_ia64_reloc (abfd, reloc, sym, data
 
 #define IA64_HOWTO(TYPE, NAME, SIZE, PCREL, IN)			\
   HOWTO (TYPE, 0, SIZE, 0, PCREL, 0, complain_overflow_signed,	\
-	 elfNN_ia64_reloc, NAME, FALSE, 0, 0, IN)
+	 elfNN_ia64_reloc, NAME, FALSE, -1LL, -1LL, IN)
 
 /* This table has to be sorted according to increasing number of the
    TYPE field.  */


More information about the Binutils mailing list