On Tue, 2017-01-31 at 17:19 +0000, Thomas Preudhomme wrote:
> 1. Why is the lock used by at_quick_exit() not required - I have
no
> idea. The linking error (when I do not provide storage for this
lock)
> about multiple definitions is visible only when I actually use the
> at_quick_exit() function.
That makes sense. If you don't use at_quick_exit then probably no
symbol in the
corresponding object file is referenced and therefore the file is not
linked in.
That's exactly why the "doubly defined error on missing symbol" work
as
explained in the cover letter: file with dummy symbol is only linked
in if it
solves an undefined reference.
This case seems a bit different, as it applies only to the
at_quick_exit() lock. In my code I have no references to "env" or "tz"
locks either, but I cannot drop these objects without the "multiple
definitions" error. Maybe my test is flawed, but browsing the assembly
output does not show any uses of __tz_lock(), __tz_unlock(),
__env_lock() or __env_unlock() functions (which are not present in the
output file), and these are the only places of newlib which use this
particular locks. I'll try later with a simpler project.