[PATCH] D13950: ELF2: Implement --gc-sections.

Rafael EspĂ­ndola via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 21 15:44:40 PDT 2015


On 21 October 2015 at 18:34, Rui Ueyama <ruiu at google.com> wrote:
> ruiu added a comment.
>
> By the way, do you think there's a better way to visit all successors than the way I did in MarkLive? I think the code is not bad (forEachSuccessor and doForEachSuccessor are about 40 lines in total), but I feel that the code is a bit awkward. Is there any way to iterate over both REL and RELA relocations without using templates? Is there a better way to visit both non-local and local symbols?

I think the way you wrote it is fine.

If you want to avoid the template, you can pass just the entsize
(sizeof(Elf_Rel) or Elf_Rela). Elf_Rela inherits from Elf_Rel, so it
is defined behavior.

Cheers,
Rafael


More information about the llvm-commits mailing list