Currently, llvm-objcopy incorrectly handles compression and decompression of the
sections from COMDAT groups, because we do not implement the
replaceSectionReferences for this type of the sections.
The patch does that.
Differential D59638
[llvm-objcopy] - Implement replaceSectionReferences for GroupSection class. grimar on Mar 21 2019, 6:30 AM. Authored by
Details
Currently, llvm-objcopy incorrectly handles compression and decompression of the The patch does that.
Diff Detail
Event TimelineComment Actions Looks good apart from a few comments.
Comment Actions Hmm, I suppose for strict correctness, you should also check if the associated symbol table needs updating too. Comment Actions Could you elaborate please what you have in mind? We currently already update all the symbols in the symbol table. Spec says (https://docs.oracle.com/cd/E19683-01/816-1386/chapter7-26/index.html): Comment Actions Yes, the symbols are correctly updated, and it's not possible to break the behaviour with the current switches available in llvm-objcopy, I think, but theoretically, there's nothing stopping us replacing the symbol table itself. The GroupSection class has a pointer to a SymbolTableSection, which will point at the wrong section if that symbol table ever gets replaced. In other words, I think you should probably add this to the replaceSectionReferences definition for strict correctness: if (SectionBase *To = FromTo.lookup(SymTab)) Symtab = To; On the other hand, symbol table replacing will cause other issues, so if you don't want to do it, I guess that's okay for now? Comment Actions I see. Symbol table replacement would definitely require much more changes everywhere I think. |