[PATCH] Entry point function should never be dead-stripped.

Shankar Kalpathi Easwaran shankarke at gmail.com
Mon Aug 26 18:47:38 PDT 2013


  In the same way that all undefined symbols are added to a vector and the list is processed one at a time. Since there is only one entry symbol, there is no need to have it in the vector.

  For example with ELF, I will add the code in ExecutableWriter<ELFT>::addDefaultAtoms, after adding the entrySymbolName.

  I think a more cleaner approach would be to

  a) Add an attribute deadStrip to undefined atom as well.
  b) Set the deadStrip property to deadStripNever. This will make it cleaner that there is only one way of adding to the deadStripRootSet.
  c) The resolver when it coalesces, has to copy over this attribute from the undefined atom, so that the information would continue to exist after the symbol is resolved.

  Nick, what do you think of options (a),(b)

http://llvm-reviews.chandlerc.com/D1524



More information about the llvm-commits mailing list