[PATCH] D118840: [ELF] Support (TYPE=<value>) to customize the output section type

Peter Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 3 02:16:05 PST 2022


peter.smith added a comment.

Not had a chance to look through the code, this is based on the description and the test so my apologies if the answers are in the code.

Initial thoughts are that this could be quite useful for creating more specific types from more general ones like raw data, although in the majority of cases input section type != output section type is likely a mistake. I'm guessing the interesting part will be dealing with the error and edge cases. For example:

- Do the input sections have to be compatible with the output section type?
- If they are not compatible, which takes precedent the input or output section type?
- Are there, for want of a better word, coercions from one type to another, for example can SHT_NOBITS input sections be coerced into SHT_PROGBITS so that zeroes are written into the file.

I note in the example that all of your examples are of the form of linker script data directives BYTE, QUAD etc. Would it make sense to restrict this to OutputSections with no InputSections or at least non executable input sections?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D118840



More information about the llvm-commits mailing list