Article View: gnu.misc.discuss
Article #2304Binutils on the i860
From: Jan Rychter
Date: Thu, 05 Oct 1995 00:00
Date: Thu, 05 Oct 1995 00:00
100 lines
4389 bytes
4389 bytes
Now, this might well be an off-topic post, but nowhere in the
binutils documentation any developpers-list is mentioned. So I am
posting it here. Maybe there will be someone able to help, if not -
please direct me to an appropriate list.
I am working on GNU gas for the Intel i860 as a target. Someone has
written the i860-specific part of GAS a long time ago, but it has been
since forgotten and is mostly obsolete. I have rewritten it almost
completely, trying to make it work with bfd, specifically - the ELF .o
format.
This is a plea for help -- I have stumbled onto an unexpected
problem, which might take an experienced binutils person 5 minutes to
spot and resolve.
I have defined
elf_i860_howto_table[]
bfd_elf32_bfd_reloc_type_lookup
elf_info_to_howto
in the elf32-i860.c file. I used bfd_elf_generic_reloc to do the
relocations. The machine-specific relocation stuff (md_apply_fix in
tc-i860.c) is done. The assembler emits all the relocations properly,
then does the initial fixup, but segfaults at the end, just before
producing an .o file.
Now, there must be something I left undefined or did wrong. It took
me a while to figure out just what I will need to implement an i860
bfd backend. The bfd documentation is almost unexisting. I am
probably missing some more functions...
The message I get is:
elf_symbol_from_bfd_symbol 0x080361ec, name = *ABS*, sym num =
134619136, flags = 0x00000100 (null)
Here's the output from gdb:
------------
Program received signal SIGSEGV, Segmentation fault.
0x80219f5 in elf_symbol_from_bfd_symbol (abfd=0x8062000,
asym_ptr_ptr=0xbffff74c) at elfcode.h:2685
2685 asym_ptr->udata = elf_section_syms
(abfd)[indx]->udata;
----------
(gdb) p asym_ptr
$1 = (asymbol *) 0x80361ec
(gdb) p asym_ptr->udata
$2 = (void *) 0x0
(gdb) p *asym_ptr
$3 = {the_bfd = 0x0, name = 0x8036222 "*ABS*", value = 0, flags = 256,
section = 0x8036340, udata = 0x0}
------------
(gdb) bt
#0 0x80219f5 in elf_symbol_from_bfd_symbol (abfd=0x8062000,
asym_ptr_ptr=0xbffff74c) at elfcode.h:2685
#1 0x801ea83 in bfd_elf32__write_relocs (abfd=0x8062000,
sec=0x8062f08,
xxx=0x0) at elfcode.h:1151
#2 0x801a241 in bfd_map_over_sections (abfd=0x8062000,
operation=0x801e800 <bfd_elf32__write_relocs>, user_storage=0x0)
at section.c:738
#3 0x8021435 in bfd_elf32_write_object_contents (abfd=0x8062000)
at elfcode.h:2501
#4 0x8017fc3 in bfd_close (abfd=0x8062000) at opncls.c:344
#5 0x800ba5e in output_file_close (filename=0x803322d "a.out")
at output-file.c:67
#6 0x8006a3a in main (argc=2, argv=0x8061000) at as.c:436
#7 0x8001414 in ___crt_dummy__ ()
-----------
and the relevant portion of the code...:
2670 && (flags & BSF_SECTION_SYM)
2671 && asym_ptr->section)
2672 {
2673 int indx;
2674
2675 fprintf (stderr,
2676 "elf_symbol_from_bfd_symbol 0x%.8lx, name = %s,
sym num = %d, flags = 0x%.8lx %s\n",
2677 (long) asym_ptr, asym_ptr->name, idx, flags, 0);
2678 fflush (stderr);
2679
2680 if (asym_ptr->section->output_section != NULL)
2681 indx = asym_ptr->section->output_section->index;
2682 else
2683 indx = asym_ptr->section->index;
2684 if (elf_section_syms (abfd)[indx])
2685 asym_ptr->udata = elf_section_syms
(abfd)[indx]->udata;
2686 }
2687
2688 if (asym_ptr->udata)
2689 idx = ((Elf_Sym_Extra *) asym_ptr->udata)->elf_sym_num;
any hints appreciated,
jwr
_________________________________________________________________________
Jan Rychter <jwr@itc.pw.edu.pl>
http://www.itc.pw.edu.pl/~jwr <jwr@icm.edu.pl>
Technical Details
Message-ID:
<450nbf$o0s@parnas.mimuw.edu.pl>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 11318c,3ab4eaeb8294f7a9,start X-Google-Attributes: gid11318c,public X-Google-Thread: 1025b4,3ab4eaeb8294f7a9,start X-Google-Attributes: gid1025b4,public From: jwr@itc.pw.edu.pl (Jan Rychter) Subject: Binutils on the i860 Date: 1995/10/05 Message-ID: <450nbf$o0s@parnas.mimuw.edu.pl> X-Deja-AN: 117107542 organization: Division of Mathematics, Informatics and Mechanics, Warsaw University keywords: i860, intel, gcc, binutils newsgroups: gnu.misc.discuss,gnu.gcc.help