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]

Re: How can I link a program with a starting address of 0x100000000for its text?


Alan Modra <amodra@bigpond.net.au> writes:

> 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.

This fixes indeed the problem, thanks.  Now I only see:
 In function `_start':
../sysdeps/x86_64/elf/start.S:89: relocation truncated to fit: R_X86_64_32S __libc_csu_fini
[...]lib64/crt1.o(.text+0x1a):../sysdeps/x86_64/elf/start.S:90: relocation truncated to fit: R_X86_64_32S __libc_csu_init
[...]lib64/crt1.o(.text+0x21):../sysdeps/x86_64/elf/start.S:92: relocation truncated to fit: R_X86_64_32S main
/usr/lib64/gcc-lib/x86_64-suse-linux/3.3.3/crtend.o(.text+0x8): In function `__do_global_ctors_aux':
: relocation truncated to fit: R_X86_64_32S .ctors

*BUT* The reporter uses an address above 2GB and this will not work
with the small code model that is used.  For this the large code model
has to be used and this is not implemented in GCC yet,

Andreas
-- 
 Andreas Jaeger, aj@suse.de, http://www.suse.de/~aj
  SUSE Linux AG, Maxfeldstr. 5, 90409 Nürnberg, Germany
   GPG fingerprint = 93A3 365E CE47 B889 DF7F  FED1 389A 563C C272 A126

Attachment: pgp00000.pgp
Description: PGP signature


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