This is based on D39348, but adds a new kind of input file JustSymbolsFile which is derived from ELFFileBase. The argument is treated as a normal input file so the case where it is the sole input works and we get to reuse some of code from ELFFileBase.
Sorry I missed this one.
You can just call Files.push_back(createJustSymbolsFile(MBRef)) instead of calling addFile.
|30 ↗||(On Diff #127076)|
I don't like an optional argument in general. Please avoid using it in lld.
Obviously you need a comment just like other code blocks.
Added a check to only allow ET_EXEC and the corresponding test.
On Tue, Dec 19, 2017 at 9:54 AM, Rafael Avila de Espindola <firstname.lastname@example.org> wrote:
This patch allows --just-symbols to be a ET_DYN, ET_REL or ET_EXEC. Do
you need all 3? ET_REL in particular seems problematic since st_value
has a different meaning in relocatable files.
If you don't need ET_DYN or ET_REL, please reject them. If you need
them, please add a test.
ld.bfd accepts ET_EXEC and ET_REL but not ET_DYN. However I don't think this option makes much sense for ET_REL inputs so I'm restricting it to ET_EXEC for now.