gcl-devel
[Top][All Lists]
Advanced

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

[Gcl-devel] Re: bfd_get_relocated_section_contents on hppa and ia64


From: Camm Maguire
Subject: [Gcl-devel] Re: bfd_get_relocated_section_contents on hppa and ia64
Date: Fri, 22 Oct 2010 12:46:12 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux)

Greetings!  I can't seem to find documentation anywhere on the sparc64
R_SPARC_OLO10 reloc, sometimes reported as a R_SPARC_LO10 and a
R_SPARC_13.  I know there is a special addend encoded in the reloc
type.  Can you explain to me or point out to me how this reloc is
supposed to work?

Take care,

Nick Clifton <address@hidden> writes:

> Hi Camm,
>
>> $ cat /tmp/hh.c
>> #include<stdio.h>
>>
>> int main(int argc,char *argv[]) {
>>    printf("hello\n");
>>    return 0;
>> }
>
>> Target: i486-linux-gnu
>
>> $ ./binutils/readelf -R .text /tmp/hh.o
>>
>> Hex dump of section '.text':
>>    0x00000000 5589e583 e4f083ec 10c70424 00000000 U..........$....
>>    0x00000010 e8ebffff ffb80000 0000c9c3          ............
>
> Ah ha!  You have chosen a target architecture which just happens not
> use a special reloc to handle function calls.  If you have a look at
> the relocs in the hh.o file:
>
>   % readelf -r hh.o
>   Relocation section '.rel.text' at offset 0x340 contains 2 entries:
>    Offset     Info    Type            Sym.Value  Sym. Name
>   0000000c  00000501 R_386_32          00000000   .rodata
>   00000011  00000902 R_386_PC32        00000000   puts
>
> You will see that it only uses the R_386_32 (a 32-bit fixed-location
> reloc) and the R_386_PC32 (32-bit PC-relative) relocs.  Both of which
> readelf implements because it can find them in debug sections.
>
> If you try compiling your test program for a different architecture,
> say the IA64, then:
>
>   % ia64-elf-gcc -c hh.c
>   % ia64-elf-readelf -R .text hh.o
>   Hex dump of section '.text':
>   readelf: Warning: unable to apply unsupported reloc type 134 to
> section .text
>   readelf: Warning: unable to apply unsupported reloc type 135 to
> section .text
>   readelf: Warning: unable to apply unsupported reloc type 73 to
> section .text
>   0x00000000 00181d0c 80054002 30004280 0167fc8c address@hidden
>
> Or the HPPA:
>
>   % hppa-linux-gnu-gcc -c hh.c
>   % hppa-linux-gnu-readelf -R .text hh.o
>   Hex dump of section '.text':
>   readelf: Warning: unable to apply unsupported reloc type 2 to
> section .text
>   readelf: Warning: unable to apply unsupported reloc type 6 to
> section .text
>   readelf: Warning: unable to apply unsupported reloc type 12 to
> section .text
>   0x00000000 6bc23fd9 08030241 081e0243 6fc10080 k.?....A...Co...
>
> Cheers
>   Nick
>
>
>
>

-- 
Camm Maguire                                        address@hidden
==========================================================================
"The earth is but one country, and mankind its citizens."  --  Baha'u'llah



reply via email to

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