[PATCH] D36986: [ELF] Handle assignments outside SECTIONS command separately

Petr Hosek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 24 17:13:42 PDT 2017


phosek added a comment.

In https://reviews.llvm.org/D36986#851730, @ruiu wrote:

> This patch is perhaps ok as-is, but I came up with another idea: we may be able to reorder commands so that all outside-sections commands follow sections commands. Then maybe we can just process them in-order. What do you think?


When you say process them in-order, do you mean all of them, including the outside-sections one? The problem right now is that if outside-sections one refer to any predefined symbol, those symbols won't have a correct value until `fixPredefinedSymbols` ran, which can only happen after we processed all `sections` commands. So we would need some way to stage the processing into sections commands, then `fixPredefinedSymbols` and then outside-sections commands. I was thinking that maybe even better would be to simply split the sections and outside-sections commands into two different lists rather then keeping them all in `Opt.Commands`, processing them separately then becomes even easier.


Repository:
  rL LLVM

https://reviews.llvm.org/D36986





More information about the llvm-commits mailing list