bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problem with 2.21 ld when linking HelenOS ia64 binaries


From: Jakub Jermar
Subject: Problem with 2.21 ld when linking HelenOS ia64 binaries
Date: Sun, 10 Apr 2011 00:29:29 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.14) Gecko/20110223 Thunderbird/3.1.8

Hello,

I am trying to understand one issue that we started to hit after
switching from binutils 2.20 to binutils 2.21 and was hoping that
someone from this list could help me. To set this into a context, we are
cross-building HelenOS for ia64-pc-linux-gnu.

The following instruction:

        addl r36 = @ltoff(@fptr(__entry#)), gp

gets linked as either (ld 2.20):

28806:       40 02 04 00 48 20                   addl r36=0,r1

or (ld 2.21):

24846:       40 02 07 8c 48 20                   addl r36=9056,r1

The latter is wrong as the computed address lies far beyond our .got and
even far beyond the data segment.

The linker script remains the same, the only thing which changed is ld
version.

The linker script for both cases is this:

STARTUP(LIBC_PATH/arch/UARCH/src/entry.o)
ENTRY(__entry)

PHDRS {
        text PT_LOAD FLAGS(5);
        data PT_LOAD FLAGS(6);
}

SECTIONS {
        . = 0x4000 + SIZEOF_HEADERS;
        
        .init : {
                *(.init);
        } :text
        
        .text : {
                *(.text .text.*);
                *(.rodata .rodata.*);
        } :text
        
        . = . + 0x4000;
        
        .got : {
                _gp = .;
                *(.got .got.*);
        } :data
        
        .data : {
                *(.opd);
                *(.data .data.*);
                *(.sdata);
        } :data
        
        .tdata : {
                _tdata_start = .;
                *(.tdata);
                _tdata_end = .;
                _tbss_start = .;
                *(.tbss);
                _tbss_end = .;
        } :data
        
        _tls_alignment = ALIGNOF(.tdata);
        
        .bss : {
                *(.sbss);
                *(.scommon);
                *(COMMON);
                *(.bss);
        } :data
        
        /DISCARD/ : {
                *(*);
        }
}

I would be grateful for any hint that would explain the sudden runaway
gp offset.

Regards,
Jakub



reply via email to

[Prev in Thread] Current Thread [Next in Thread]