gcl-devel
[Top][All Lists]
Advanced

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

[Gcl-devel] BFD test program


From: Mike Thomas
Subject: [Gcl-devel] BFD test program
Date: Tue, 16 Jul 2002 10:36:13 +1000

Hi Camm.

Things are desperate, so I have resorted to making a separate BFD test
program which is attached.  Basically it reads the symbol table in a GCL
executable and then tries to load and relocate a previously compiled object
file.  It is based on "build_symbol_table_bfd()" and "fasload()".

I would appreciate it greatly if you could take the time to do the following
on an i386 Linux box, letting me know what happens and also offereing any
advice you may have:

1. cd to the top of your GCL source tree, with a built "saved_gcl" in the
unixport directory.

2. cat > t.lsp
(defun t (a b) (+ a b))

3. ./unixport /saved_gcl

4. (compile-file "t.lsp")

5. (by)

6. build the attached source file:

    gcc bfdtest.c -g -lbfd -liberty -o bfdtest

7. and run the resulting executable, logging the output:

    ./bfdtest   ./unixport/saved_gcl   t.o >& run.log

8. send me the resulting log.

The resulting output from my Win 2000 machine is below, for comparison and
comment.  Any explanation of what this stuff is trying to achieve during the
initialisation phase (vma setting etc) would also be appreciated!

Cheers

Mike Thomas.

================================================
$ ./bfdtest.exe ./unixport/saved_gcl.exe tg.o
BUILDING EXECUTABLE SYMBOL TABLE (ARGV[1])

Allocating symbol table (38572 bytes)
CALCULATING CURRENT, MAX_ALIGN and ALLOCATING )

round_up: address = 0, n = 4, returning 0
Section .text: owner = 3f2438, output_offset = 0, output_section = 3faffc
(.text
)
round_up: address = 136, n = 4, returning 136
Section .data: owner = 3f2438, output_offset = 0, output_section = 3fb094
(.data
)
round_up: address = 140, n = 4, returning 140
Section .bss: owner = 3f2438, output_offset = 0, output_section = 3fb12c
(.bss)
ALLOCATED 140 bytes

max_align = 4, current = 140, cfd_self  = 0, cfd_size  = 8c, cfd_start =
56ff00
round_up: address = 5701376, n = 4, returning 5701376
max_align = 4, current = 140, cfd_self  = 0, cfd_size  = 8c, cfd_start =
56ff00
SETTING VMA'S

round_up: address = 5701376, n = 4, returning 5701376
Section .text: owner = 3f2438, output_offset = 0, output_section = 3faffc
(.text
), vma = 56ff00, m = 56ff88
round_up: address = 5701512, n = 4, returning 5701512
Section .data: owner = 3f2438, output_offset = 0, output_section = 3fb094
(.data
), vma = 56ff88, m = 56ff8c
round_up: address = 5701516, n = 4, returning 5701516
Section .bss: owner = 3f2438, output_offset = 0, output_section = 3fb12c
(.bss),
 vma = 56ff8c, m = 56ff8c


DOING SOMETHING WITH THE HASHED SYMBOLS

q[0]->name = t.c
q[1]->name = gcc2_compiled.
q[2]->name = ___gnu_compiled_c
q[3]->name = _VVi
q[4]->name = _init_code
q[5]->name = _L1
q[6]->name = .text
q[7]->name = .data
q[8]->name = .bss
q[9]->name = _vs_base
q[10]->name = _vs_top
q[11]->name = _vs_limit
q[12]->name = _number_plus
q[13]->name = _vs_overflow
q[14]->name = _do_init


DOING RELOCATIONSs->name .text, s->flags = 237
About to get reloc section contents
b = 3f2438, section .text, s->output_section = 3faffc, q = 3f2918

(HERE IT FALLS OVER AS PREVIOUSLY REPORTED IN
"bfd_get_relocated_section_contents()" )

Attachment: bfdtest.c
Description: Binary data


reply via email to

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