How can I link a program with a starting address of 0x100000000 for its text?

Alan Modra amodra@bigpond.net.au
Sat Jun 12 11:28:00 GMT 2004


On Sat, Jun 12, 2004 at 02:20:42PM +0300, M. Giannakidis wrote:
> initial assignment to '.', generated addresses above 0x80000000 (2Gb)
> 
> The errors produced be the linker were: 
> In function start:
> ... relocation truncated to fit: R_X86_64_32S __libc_csu_fini
> ... relocation truncated to fit: R_X86_64_32S __libc_csu_init
> ... relocation truncated to fit: R_X86_64_32S main
> In function frame_dummy:
> ... relocation truncated to fit: R_X86_64_PC32 _Jv_RegisterClasses
> ... relocation truncated to fit: R_X86_64_32S .ctros
[snip]
> What is it I'm missing in the 64bit environment?

Bug fixes to elf64-x86-64.c, probably.  :)  The following should silence
the _Jv_RegisterClasses warning.  I'll leave the rest of the fix to
the x86_64 maintainers, as I don't have crt files for x86_64 handy.

	* elf64-x86-64.c (elf64_x86_64_relocate_section): Don't warn on
	branches to undefweaks.

Index: bfd/elf64-x86-64.c
===================================================================
RCS file: /cvs/src/src/bfd/elf64-x86-64.c,v
retrieving revision 1.78
diff -u -p -r1.78 elf64-x86-64.c
--- bfd/elf64-x86-64.c	11 May 2004 17:08:37 -0000	1.78
+++ bfd/elf64-x86-64.c	12 Jun 2004 11:21:56 -0000
@@ -2420,6 +2420,11 @@ elf64_x86_64_relocate_section (bfd *outp
 
 	  if (r == bfd_reloc_overflow)
 	    {
+	      if (h != NULL
+		  && h->root.type == bfd_link_hash_undefweak
+		  && howto->pc_relative)
+		/* Ignore reloc overflow on branches to undefweak syms.  */
+		continue;
 
 	      if (! ((*info->callbacks->reloc_overflow)
 		     (info, name, howto->name, (bfd_vma) 0,

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre



More information about the Binutils mailing list