This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Bug when merging visibility?
- From: "H. J. Lu" <hjl at lucon dot org>
- To: binutils at sources dot redhat dot com
- Date: Fri, 28 Mar 2003 11:55:56 -0800
- Subject: 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.