[PATCH] D59649: [ELF] Improve error message for relocations to symbols defined in discarded sections

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 22 01:35:16 PDT 2019


MaskRay marked an inline comment as done.
MaskRay added a comment.

In D59649#1511494 <https://reviews.llvm.org/D59649#1511494>, @ruiu wrote:

> Overall looking good.
>
> Somewhat unrelated, but maybe we should clear ComdatGroups map once name resolution pass is done? COMDAT signatures are long strings, and discarding them from memory might save nontrivial amount of memory.


Good point. I can do that in a separate change.



================
Comment at: ELF/InputFiles.cpp:117
-  // is used to uniquify them.
-  static llvm::DenseSet<llvm::CachedHashStringRef> ComdatGroups;
-
----------------
ruiu wrote:
> Why did you move this to Symtab?
Relocations.cpp needs to access the variable to check which section is prevailing.

It was originally in Symtab until you moved it to a function-local static variable.. It can also be a global variable if you prefer.


Repository:
  rLLD LLVM Linker

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

https://reviews.llvm.org/D59649





More information about the llvm-commits mailing list