This is the mail archive of the binutils@sources.redhat.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]
Other format: [Raw text]

Bug when merging visibility?


Therea are

#define STV_DEFAULT     0               /* Visibility is specified by binding
type */
#define STV_INTERNAL    1               /* OS specific version of STV_HIDDEN */
#define STV_HIDDEN      2               /* Can only be seen inside currect
component */
#define STV_PROTECTED   3               /* Treat as STB_LOCAL inside current
component */
g

We do

             unsigned char hvis, symvis, other;
                                                                                
              /* Take the balance of OTHER from the definition.  */
              other = (definition ? isym->st_other : h->other);
              other &= ~ ELF_ST_VISIBILITY (-1);
                                                                                
              /* Combine visibilities, using the most constraining one.  */
              hvis   = ELF_ST_VISIBILITY (h->other);
              symvis = ELF_ST_VISIBILITY (isym->st_other);
                                                                                
              h->other = other | (hvis > symvis ? hvis : symvis);
 
It asssumes that the higher the value is, the more constraining the
visibility is. That means the order is

STV_DEFAULT < STV_INTERNAL < STV_HIDDEN < STV_PROTECTED

It doesn't look right to me. Should that be

STV_DEFAULT < STV_PROTECTED < STV_HIDDEN < STV_INTERNAL


H.J.


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