[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug binutils/14009] gcc 4.7 conversion to init_array breaks users needi

From: igodard at pacbell dot net
Subject: [Bug binutils/14009] gcc 4.7 conversion to init_array breaks users needing control of C++ static initialization order
Date: Sun, 22 Apr 2012 22:50:21 +0000


--- Comment #6 from Ivan Godard <igodard at pacbell dot net> 2012-04-22 
22:50:21 UTC ---
We manually maintain, for each project (== library in our environment) a list
of intra-project dependencies (file a must be initialized before file b) and
inter-project dependencies (everything used from library A must be initialized
before library B). A tool analyses the command line to collect the names of
everything that *might* go into the build, from which (and the dependency
lists) it produces a partial order that satisfies ordering. Note that not
everything in the partial order will actually wind up in the build; the linker
selects files from libraries normally. The inter-project dependency is the same
info we use to determine Make order when rebuilding the world.

The tool then takes a copy of the gcc default linker script (using the default
means we get any gnu magic right in the script) and creates a new script with
added KEEP commands in the right places, ordered as indicated by the partial
order, with a little armwaving to get crtend at the right place. The redundant
KEEPs for modules the linker didn't use are harmless. This script is passed to
collect2, which passes it on to the real linker. Voila!

Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]