ld(1) -zignore can erroneously discard init and fini arrays as unreferenced
.init_array and .fini_array are referenced via the entries in .dynamic, and not by the program text otherwise.
ld(1)'s ignore processing needs to know that these sections are special and cannot be discarded in that fashion.
When these sections are ignored, the DT_ entries are still created, with 0 address and size. The linker is smart enough not to call NULL in these cases, but applications dependent on their initialization having occurred will fail.
Updated by Electric Monk over 4 years ago
- Status changed from In Progress to Closed
- % Done changed from 0 to 100
commit a0fb1590788f4dcbcee3fabaeb082ab7d1ad4203 Author: Richard Lowe <firstname.lastname@example.org> Date: 2016-08-27T22:38:54.000Z 7323 ld(1) -zignore can erroneously discard init and fini arrays as unreferenced Reviewed by: Dan McDonald <email@example.com> Reviewed by: Robert Mustacchi <firstname.lastname@example.org> Reviewed by: Patrick Mooney <email@example.com> Approved by: Gordon Ross <firstname.lastname@example.org>