This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: bfd_get_relocated_section_contents on hppa and ia64
- From: Camm Maguire <camm at maguirefamily dot org>
- To: Nick Clifton <nickc at redhat dot com>
- Cc: binutils at sourceware dot org, gcl-devel at gnu dot org
- Date: Fri, 22 Oct 2010 12:46:12 -0400
- Subject: Re: bfd_get_relocated_section_contents on hppa and ia64
- References: <E1NaaJq-0006Ia-OP@localhost.m.enhanced.com> <4B62BD4E.50208@redhat.com> <871vh4lg2m.fsf@maguirefamily.org> <4B67F17B.5080703@redhat.com> <87eiiim2ux.fsf@maguirefamily.org> <4BC742A8.70602@redhat.com> <878w8fpo0b.fsf@maguirefamily.org> <4BD06453.2020204@redhat.com> <87bpdacm43.fsf@maguirefamily.org> <4BD6D662.6070306@redhat.com> <87r5lzr7dt.fsf@maguirefamily.org> <4BD84FA8.20509@redhat.com> <877hnql12l.fsf@maguirefamily.org> <4BDADE6A.9010802@redhat.com>
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 <nickc@redhat.com> 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 ......@.0.B..g..
>
> 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 camm@maguirefamily.org
==========================================================================
"The earth is but one country, and mankind its citizens." -- Baha'u'llah