X-Date: 31 Oct 2000 14:56:11 -0000 --> Re: more on h8300-rtems/coff core dump
d>[Date Prev] [Date Next]
Index Nav: [Date Index] [Subject Index] [Author I] [Thread Index]
Message Nav: [Thread Prev] [Thread Next]

Re: more on h8300-rtems/coff core dump


Alan Modrote:
> 
> On Mon, 30 Oct 2000, Joel Sherrill wrote:
> 
> > There is a loop around line 321 of bfd/reloc16.c ie routine
> > bfd_coff_reloc16_get_relocated_section_contents().  Somehow
> > "run" is set to 4294967088 (0xffff) for this case.
> > Doing a "p *input_bfd" shows me that the file being processed
> > at this point is a .rel ( collected with ld -r).
> 
> Presumably this is from a reloc that gets mangled somehow.  What do
> reloc_vector, recount, and link_order look like for the bad case?
> Can you find the corresponding relocs in the .o and .rel file?  How dt; they differ?

I think I am catching everything at the correct point.  This is
complicated
and I am a bit unsure.  I realiovernight that I can probably produce
a test case that is just asm files if that will help anyone.

Bad case:

(gdb) p relocnt
$1 = 67296
(gdb) p **reloc_vector
$4 = {sym_ptr_ptr = 0x80a0e4c, address = 32, addend = 0, howto =
0x8082f7c}
(gdb) p **r_vector->sym_ptr_ptr
$8 = {the_bfd = 0x8099140, name = 0x809d63d
"__CPU_Thread_dispatch_pointer", 
  value = 0, flags = 2ction = 0x8081c44, udata = {p = 0x808d4e4, 
    i = 134796516}}

__CPU_Thread_dispatch_pointer is an 
"extern void  (*_CPU_Td_dispatch_pointer)();" for the files in
question.

(gdb) p *link_order
$10 = {next = 0x0, type = bfd_indirect_link_order, ot = 44, size =
728, 
  u = {indirect = {section = 0x8099508}, fill = {value = 134845704},
data = {
      contents = 0x809950\224\t\b\001"}, reloc = {p = 0x8099508}}}
(gdb) p *link_order->u.indirect.section
$12 = {name = 0x80994fc ".text", index  next = 0x80996f8, flags =
551, 
  user_set_vma = 0, reloc_done = 0, linker_mark = 1, gc_mark = 0, vma =
0, 
  lma = 0, _coosize = 728, _raw_size = 728, output_offset = 44, 
  output_section = 0x808c364, alignment_power = 1, relocation =
0x80a10f0,orelocation = 0x0, reloc_count = 31, filepos = 220, rel_filepos = 948, 
  line_filepos = 1444, userdata = 0x0, contents = 0xineno =
0x809a090, 
  lineno_count = 23, comdat = 0x0, moving_line_filepos = 0, target_index
= 2, 
  used_by_bfd = 0x80a130cnstructor_chain = 0x0, owner = 0x8099140, 
  symbol = 0x8099588, symbol_ptr_ptr = 0x8099578, link_order_head = 0x0, 
  link_r_tail = 0x0}

Good case for the same symbol:

(gdb) p reloc_count
$21 = 10

(gdb) p **reloc_vector->sym_ptr_ptr
$18 = {tfd = 0x809b3e0, name = 0x809e8a7
"__CPU_Thread_dispatch_pointer", 
  value = 0, flags = 2, section = 0x8081c44, udata = {p =08d49c, 
    i = 134796444}}

(gdb) p *link_order
$22 = {next = 0x0, type = bfd_indirect_link_order, offset = 426, size =
33  u = {indirect = {section = 0x809b558}, fill = {value = 134853976},
data = {
      contents = 0x809b558 "Lµ\t\b"}, reloc =  0x809b558}}}
(gdb) p *link_order->u.indirect.section
$23 = {name = 0x809b54c ".text", index = 0, next = 0x809b748, flags51, 
  user_set_vma = 0, reloc_done = 0, linker_mark = 1, gc_mark = 0, vma =
0, 
  lma = 0, _cooked_size = 334, _raw_size =  output_offset = 426, 
  output_section = 0x808c364, alignment_power = 1, relocation =
0x809c294, 
  orelocation = 0x0, relount = 10, filepos = 140, rel_filepos = 474, 
  line_filepos = 634, userdata = 0x0, contents = 0x0, lineno =
0x809c12c, 
  li_count = 21, comdat = 0x0, moving_line_filepos = 0, target_index
= 1, 
  used_by_bfd = 0x0, constructor_chain = 0x0, owner =09b3e0, 
  symbol = 0x809b5d8, symbol_ptr_ptr = 0x809b5c8, link_order_head = 0x0, 
  link_order_tail = 0x0}

In the bad caseoc_count is 67296 while in the good case, it is 10.

I don't know the structures well enough to guess where any important
diences are.

Thanks for the help.  Hopefully you can tell something. :)


> --
> Linuxcare.  Support for the Revolution- 
Joel Sherrill, Ph.D.             Director of Research & Development
joel@OARcorp.com                 On-Line Applicat Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
   Support Available             (256) 722-9985

<e border="0"> Index Nav: [Date In/A>] [Subject Index] [Author Index] [Thread Index] Message Nav: [Date Prev] [Date Next] [Thread&nPrev] [Thread Next]