https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65780

--- Comment #34 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to Jeffrey A. Law from comment #29)
> What I'm trying to wrap my head around is what "defined_locally" really
> means.  Is it a "must" or "maybe" property when it gets set in
> default_binds_local_p_3?

I'd say it is a "must" property, the decl must be defined locally.
A common var is of course a corner case, because uninitialized common var
"maybe" defined locally if it doesn't have a strong definition elsewhere.
And, for executables (normal and PIE), if the linker arranges for the
definition to be present (through COPY relocation) in the executable, it "must"
be defined locally too, even if it has a strong definition in a dependent
shared library.

> If it's a must property, then "common_maybe_local" seems mis-named and/or
> mis-used (the former seems most likely to me).

I'd say mis-named; so what about common_local_p, with a comment describing it -
if the linker can guarantee that an uninited common symbol in the executable
will still be defined (through COPY relocation) in the executable, then this
flag should be set.

Reply via email to