gcl-devel
[Top][All Lists]
Advanced

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

RE: [Gcl-devel] BFD related issues - belated reply.


From: Mike Thomas
Subject: RE: [Gcl-devel] BFD related issues - belated reply.
Date: Tue, 6 Jan 2004 15:44:55 +1000

Hi Aurelien

| Sure I'd like to help out.

Thanks for that.

|  I know about this
| bfdtest.c file, which I happen to have used myself to
| test BFD dynamic loading for Mac OS X.  Unfortunately,
| I'm absolutely unacquainted to PE, which is probably
| the object file format you're using.  What I'd do is
| look at this in gdb to see what exactly is happening.
| As I don't have access to any Windows machine running
| cygwin or mingw (or whatever you're using), I can't
| look into the matter myself.  Could you provide a
| stack trace along with a generous context ?  Then, as
| I've been working on BFD for quite some time now,
| maybe I can come up with a solution.

Sounds good.

The example oputput I sent you yesterday used the standard MinGW32 libbfd
etc.

I built bfdtest from the GCL CVS bfd build today and had a complete
disaster - the exe_bfd structure gets trashed during bfd_openr() before the
executable symbol table is even built. I'll try and get to the bottom of why
it went so badly wrong before I bring you in on the debugging.


| >From my experience, the code in bfdtest.c (and in
| sfasfbfd.c) is fairly experimental, and heavily relies
| on the behavior for ELF.  Is BFD reputedly working for
| PE ?

MinGW32 and Cygwin each use it so, yes, but apparently not the parts we
need.


| I know that there's support for Windows DLL in
| GNU ld, so I suspect there should be some kind of
| minimal support for BFD as well.  Fixing the matter
| might not be that much of a headache.

For you maybe!!

Cheers

Mike Thomas.


$ gdb --directory binutils/bfd --directory binutils/libiberty/ ./bfdtest.exe
GNU gdb 6.0
Copyright 2003 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i686-pc-mingw32"...
(gdb) b bfd_init
Breakpoint 1 at 0x407033: file init.c, line 50.
(gdb) l
227
228             fprintf ( stderr, "mnotice\n");
229             return MY_BFD_FALSE;
230
231         }
232
233
234     int main ( int argc, char ** argv )
235     {
236         int init_address=-1;
(gdb) set args ./unixport/raw_gcl.exe ./lsp/gcl_sloop.o
(gdb) r
Starting program: c:\cvs\head\gcl-bfd/./bfdtest.exe ./unixport/raw_gcl.exe
./lsp
/gcl_sloop.o
In BFD fast load test. Reloc_howto_type size 52
BUILDING EXECUTABLE SYMBOL TABLE FOR ./unixport/raw_gcl.exe

Breakpoint 1, 0x00407033 in bfd_init () at init.c:50
50      {
(gdb) n
build_symbol_table_bfd (oname=0x3d2cbc "./unixport/raw_gcl.exe")
    at bfdtest.c:21
21          if ( ! ( exe_bfd = bfd_openr ( oname, 0 ) ) ) {
(gdb) n
26          if ( ! bfd_check_format ( exe_bfd, bfd_object ) ) {
(gdb) n
31          if ( !(link_info.hash = bfd_link_hash_table_create (
exe_bfd ) ) ) {

(gdb) p oname
$1 = 0x3d2cbc "./unixport/raw_gcl.exe"
(gdb) p exe_bfd
$2 = (bfd *) 0x3d5058
(gdb) p *exe_bfd
$3 = {id = 4009148, filename = 0x41c990 "l?A", xvec = 0x77c5ace0,
  iostream = 0x1, cacheable = 1, target_defaulted = 4018264,
  lru_prev = 0x3d5058, lru_next = 0x9, where = 0, opened_once = 0,
  mtime_set = 0, mtime = 0, ifd = 1, format = bfd_object, direction = 314,
  flags = 0, origin = 0, output_has_begun = 4026664, section_htab = {
    table = 0xfd3, size = 4230544, newfunc = 0x3d6100, memory = 0x3d613c},
  sections = 0x3d6440, section_tail = 0x6, section_count = 4198400,
  start_address = 11909, symcount = 0, outsymbols = 0x413cd0, dynsymcount =
0,
  arch_info = 0x0, arelt_data = 0x0, my_archive = 0x0, next = 0x0,
  archive_head = 0x0, has_armap = 0, link_next = 0x3d51f0, archive_pass = 0,
  tdata = {aout_data = 0x3d2d50, aout_ar_data = 0x3d2d50,
    oasys_obj_data = 0x3d2d50, oasys_ar_data = 0x3d2d50,
    coff_obj_data = 0x3d2d50, pe_obj_data = 0x3d2d50,
    xcoff_obj_data = 0x3d2d50, ecoff_obj_data = 0x3d2d50,
    ieee_data = 0x3d2d50, ieee_ar_data = 0x3d2d50, srec_data = 0x3d2d50,
    ihex_data = 0x3d2d50, tekhex_data = 0x3d2d50, elf_obj_data = 0x3d2d50,
    nlm_obj_data = 0x3d2d50, bout_data = 0x3d2d50, mmo_data = 0x3d2d50,
    sun_core_data = 0x3d2d50, sco5_core_data = 0x3d2d50,
    trad_core_data = 0x3d2d50, som_data = 0x3d2d50, hpux_core_data =
0x3d2d50,
    hppabsd_core_data = 0x3d2d50, sgi_core_data = 0x3d2d50,
    lynx_core_data = 0x3d2d50, osf_core_data = 0x3d2d50,
    cisco_core_data = 0x3d2d50, versados_data = 0x3d2d50,
    netbsd_core_data = 0x3d2d50, mach_o_data = 0x3d2d50,
---Type <return> to continue, or q <return> to quit---
    mach_o_fat_data = 0x3d2d50, pef_data = 0x3d2d50, pef_xlib_data =
0x3d2d50,
    sym_data = 0x3d2d50, any = 0x3d2d50}, usrdata = 0xabababab,
  memory = 0xabababab}
(gdb) p _bfd_link_hash_table_create
No symbol "_bfd_link_hash_table_create" in current context.
(gdb) p exe_bfd->xvec
$4 = (const struct bfd_target *) 0x77c5ace0
(gdb) p exe_bfd->xvec->_bfd_link_hash_table_create
$5 = (struct bfd_link_hash_table *(*)()) 0
(gdb)






reply via email to

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