This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc 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]

Re: initfini.c -> crt[in].S


> I'd think it would be more interesting (but hard) to have CFI that covers 
> whatever calls go in the middle of .init/.fini, than just to cover the 
> instructions in the prologue and epilogue by treating those as separate 
> functions.

Indeed.  I was first thinking that the prologue/epilogue were all that
would really matter, since they're the only places changing the CFI state.
But unwinding won't find that state at all from an inside PC with no CFI at
all.  Ironically, producing full CFI for each function is probably pretty
straightforward if you roll it by hand instead of using .cfi_* directives.

> > It's fine to use an abstract description like yours when the condition
> > has hairy syntax like this one does.  But the [] convention makes it
> 
> Indeeed, I tried the [] syntax, but with [ifneq (,$(wildcard 
> $(sysdirs:%=%/crti.S)))] the logs are even less readable.

I meant, it's fine to use an abstract description inside [].
Your wording without [] makes it not at all clear it's referring
to conditionalized code.  Please fix that.

> > What does .hidden even mean on an undefined symbol?
> 
> It sets STV_HIDDEN on the undefined symbol.  See 
> <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20218> for why GCC generates 
> it.  Given that the symbol will always be defined, and have hidden 
> visibility on the definition, it's not strictly necessary (the visibility 
> from the definition will apply as the most restrictive visibility in any 
> object in the link) - but it seems cleaner to me to give the symbol the 
> same visibility on the use as on the definition, just as GCC does.

There's too much history in that bug for me to entirely follow it.
I think the upshot is that people annotating references with hidden
but not annotating definitions expect that (by this ELF rule) the
symbol will wind up hidden.  But that's not the situation here, and
it's plenty normal not to annotate references but only definitions,
since the former is just to optimize code generation.  But given that
the code here is optimized with that expectation (i.e. no @PLT on the
call), I suppose it is consistent to annotate this reference.


This now looks fine enough to me modulo [] syntax in the log entries.
I trust you to fix that up before you commit, without waiting for another
round of review from me.


Thanks,
Roland


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