H8 assembler generates incorrect relocation entries.
Nitin Gupta, Noida
niting@noida.hcltech.com
Mon Sep 2 10:16:00 GMT 2002
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/ldscripts/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.
I'm looking into the problem. Meanwhile sending this to
seek your opinion.
Thanks and Best Regards,
Nitin.
More information about the Binutils
mailing list