RFA: gas S_IS_HIDDEN? (detecting hidden symbols in gas)

Matt Thomas matt@3am-software.com
Wed Dec 8 17:47:00 GMT 2010


For the VAX, i need to be detect whether a symbol is hidden or not
(a "global" hidden symbol can be used in an indirect addressing manner
in PIC mode while a global non-hiddden symbol can not be).

I was surprised to see there was no S_IS_HIDDEN.  So in tc-vax.c
I added:

#ifdef OBJ_ELF
static int
S_IS_HIDDEN(symbolS *symbolP)
{  
  asymbol *bfdsym; 
  elf_symbol_type *elfsym;
   
  bfdsym = symbol_get_bfdsym (symbolP);
  elfsym = elf_symbol_from (bfd_asymbol_bfd (bfdsym), bfdsym);
   
  assert (elfsym);

  return (elfsym->internal_elf_sym.st_other & 3) == STV_HIDDEN;
}
#endif

The routine works fine but it doesn't belong in tc-vax.c.  
So the question is where does it belong?  config/obj-elf.c?
symbols.c?  someplace else?  




More information about the Binutils mailing list