[PATCH] D54621: [ELF] - Do not remove empty sections referenced in LOADADDR/ADDR commands.

Peter Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 30 02:27:03 PST 2018


peter.smith added a comment.

I think that this type of script is common in embedded systems. A company will have a product family represented by a common core + variable feature sets, they often have a single linker script that is shared between the projects. This often results in some Output Sections being empty for some of the products. On larger projects it can be difficult to know when this will occur, for example all it takes is one developer to remove the use of a library to silently break a working program.

For this particular example, I don't think it is necessary to keep the .empty section in the ELF file; however I think that it is important for the calculation of the addresses of .text and .data to be either correct or we give an error message. It may be that forcibly keeping .empty is the easiest way of achieving that. An error message is not particularly friendly but it would at least alert the user that they would need to add zero sized sections or symbols to make sure the section was kept.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D54621/new/

https://reviews.llvm.org/D54621





More information about the llvm-commits mailing list