Diff Detail
Diff Detail
Event Timeline
lld/test/ELF/linkerscript/pre_init_array_empty.test | ||
---|---|---|
1 ↗ | (On Diff #387971) | preinit-array-empty.test |
6 ↗ | (On Diff #387971) | |
7 ↗ | (On Diff #387971) | Use llvm-readelf -s to check the value of __preinit_array_start. This makes better use of a test case: not just check that the link succeeds, also catches unintended value change in the future. You can add a comment that as long as __preinit_array_start=__preinit_array_end, the exact value doesn't matter. |
Comment Actions
Updated to address review comments.
However, I have also uncovered a situation where an empty .preinit_array section can be emitted and in this case, this patch would result in the value of __preinit_array_start and __preinit_array_end not matching the address of the .preinit_array section. I have created D114179 as an alternative to this patch which copes with this scenario.