[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug ld/20152] constructors for c++ objects are sometimes discarded when
From: |
nickc at redhat dot com |
Subject: |
[Bug ld/20152] constructors for c++ objects are sometimes discarded when linked via a .a archive |
Date: |
Thu, 02 Jun 2016 12:31:22 +0000 |
https://sourceware.org/bugzilla/show_bug.cgi?id=20152
Nick Clifton <nickc at redhat dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |nickc at redhat dot com
--- Comment #1 from Nick Clifton <nickc at redhat dot com> ---
Hi Dave,
> I noticed when developing a patch for GCC that C++ objects with global
> constructors are sometimes discarded if linked via a .a archive.
Why is this surprising ? The point of an archive is that contents are only
extracted from it if they are needed. If nothing in the main program
references the global object in the library then it is not included in the
link and its constructor is never run.
Cheers
Nick
--
You are receiving this mail because:
You are on the CC list for the bug.
- [Bug ld/20152] constructors for c++ objects are sometimes discarded when linked via a .a archive,
nickc at redhat dot com <=