Mail Archives: djgpp-workers/2001/06/25/13:27:43
> Then please explain how come we now need to change it because of a new
> version of GCC.
Because the gcc 3.0 port has been configured to take advantage of advanced
features. For example, link-once sections reduce code bloat from using C++
templates. But the linker script has to be changed so the linker knows where
to put these sections (either in .text, .data, etc.) after the duplicates
have been discarded.
Another example is the -finit-priority feature in gcc 2.95 and above. It
allows control over the order in which static C++ file scope objects are
constructed and destructed. gcc outputs info into .ctors.xxxxx and
.dtors.xxxxx sections (where xxxxx is a number based on the priority). The
linker script much be changed to sort these .[cd]tors.* sections and place
them so they get called in the right order.
Mark
- Raw text -