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 about 5 years ago
- Status changed from In Progress to Closed
- % Done changed from 0 to 100
commit a0fb1590788f4dcbcee3fabaeb082ab7d1ad4203 Author: Richard Lowe <email@example.com> Date: 2016-08-27T22:38:54.000Z 7323 ld(1) -zignore can erroneously discard init and fini arrays as unreferenced Reviewed by: Dan McDonald <firstname.lastname@example.org> Reviewed by: Robert Mustacchi <email@example.com> Reviewed by: Patrick Mooney <firstname.lastname@example.org> Approved by: Gordon Ross <email@example.com>