This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
RE: H8 assembler generates incorrect relocation entries.
- From: "Dhananjay R. Deshpande" <dhananjayd at kpit dot com>
- To: "Nitin Gupta" <niting at noida dot hcltech dot com>
- Cc: <binutils at sources dot redhat dot com>
- Date: Tue, 3 Sep 2002 19:15:28 +0530
- Subject: RE: H8 assembler generates incorrect relocation entries.
Hi,
> -----Original Message-----
> From: Nitin Gupta, Noida [mailto:niting@noida.hcltech.com]
> Sent: Monday, September 02, 2002 10:43 PM
> To: binutils@sources.redhat.com
> Subject: H8 assembler generates incorrect relocation entries.
>
>
> Hi,
> The references into the .text section
> from the DWARF debug_line and debug_info section
> are not correct when starting address is greater then
> 2 bytes. This happens for target h8300 only.
>
> Execution Steps:
> 1.) modified ldscript h8300elf.x so that the start
> address is greater then 2 bytes.
> $ diff -c3p
> /home/niting/venkat/gcc_release/h8300-elf/tools/h8300-elf/lib/
> ldscripts/h830
> 0elf.x myh8300elf.x
> ***
> /home/niting/gcc_release/h8300-elf/tools/h8300-elf/lib/ldscrip
> ts/h8300elf.x
> Thu Aug 29 17:34:57 2002
> --- myh8300elf.x Wed Aug 31 10:56:00 2002
> *************** ENTRY(_start)
> *** 9,15 ****
> SECTIONS
> {
> /* Read-only sections, merged into text segment: */
> ! . = 0x100;
> .interp : { *(.interp) }
> .hash : { *(.hash) }
> .dynsym : { *(.dynsym) }
> --- 9,15 ----
> SECTIONS
> {
> /* Read-only sections, merged into text segment: */
> ! . = 0x200200;
> .interp : { *(.interp) }
> .hash : { *(.hash) }
> .dynsym : { *(.dynsym) }
>
> 2.) Compiled and Linked the Hello World program
> in "C" with this ldscript for target=h8300 (default
> options)
> $h8300-elf-gcc -T myh8300elf.x hello.c
>
> 3.) Found the the text references from debug_line
> and debug_info only contain lower 16 bits of the
> address. Can be conformed with
> $readelf -wil a.out
>
> The Problem:
> The assembler seems to be the culprit. Because the
> relocation entries generated for reference into text
> section from DWARF sections are of type R_H8_DIR16
> whereas the .text section starting address is
> something greater then 0x200200.
First let me clear that I am not familiar with all the details of ELF file
format.( and DWARF ).
The H8300 address space is limited to 16 bit ( 0xFFFF highest ).
so all references are 16 bit. This could be the reason that assembler generates
relocation entries of type R_H8_DIR16.
Regards,
Dhananjay
>
> I'm looking into the problem. Meanwhile sending this to
> seek your opinion.
>
> Thanks and Best Regards,
> Nitin.
>
>
>
>
>