This is the mail archive of the binutils@sourceware.cygnus.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: HPPA/SOM Patch


   Date: Fri, 04 Jun 1999 13:08:43 -0700
   From: Mark Klein <mklein@dis.com>

   >If so, why is hppa_fix_adjustable being called after set_symtab?

   It is part of my earlier fix. There are certain fixups that don't
   have a symbol associated with them. In that case, the original
   code referenced a dummy symbol. I changed that to the symbol_get_bfdsym()
   call below.

   *** 2886,2892 **** 
   case R_ENTRY: 
   case R_EXIT: 
   /* There is no symbol associated with these fixups. */ 
   ! relocs[i]->sym_ptr_ptr = &dummy_symbol->bsym; 
   relocs[i]->addend = fixp->fx_offset; 
   break; 
   --- 2893,2900 ---- 
   case R_ENTRY: 
   case R_EXIT: 
   /* There is no symbol associated with these fixups. */ 
   ! relocs[i]->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *)); 
   ! *relocs[i]->sym_ptr_ptr = symbol_get_bfdsym (dummy_symbol); 
   relocs[i]->addend = fixp->fx_offset; 
   break; 

   That in turn is causing tc_gen_reloc() to be invoked within write_relocs()
   and voila!

I don't quite follow that, actually.  I don't see why calling
symbol_get_bfdsym is causing tc_gen_reloc to get called.  But I'll
take your word for it.

   So, did I make a wrong assumption here, or should set_symtab be delayed
   until after the bfd_map_over_sections (stdoutput, write_relocs, (char *) 0) ?

No, I believe set_symtab must be called before the relocations are
written out.

One way to avoid it would be to call symbol_get_bfdsym immediately
after creating dummy_symbol, to force it to be converted to a real
symbol before set_symtab is called.

Another way would be not use dummy_symbol for this at all, and instead
call bfd_create_empty_symbol directly to get something you can set the
reloc sym_ptr_ptr field to point to.

Ian

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]