[PATCH] D118529: [ELF] Rename adjustSectionsBeforeSorting to adjustOutputSections and make it affect INSERT commands

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 31 10:24:34 PST 2022


MaskRay accepted this revision.
MaskRay added a comment.
Herald added a subscriber: StephenFan.

In D118529#3284109 <https://reviews.llvm.org/D118529#3284109>, @peter.smith wrote:

> Would it be possible to go a bit further and move all the functionality from `adjustSections` that isn't important for placing Orphan Sections to `adjustSectionsAfterSorting`. We'd then be able to give `adjustSections` a more specific name. For example `adjustOutputSectionFlags`. As it stands `adjustSections` could mean almost anything.
>
> No objections to the work done so far though.

It's difficult to split `adjustSectionsBeforeSorting`. The `isDiscardable` functionality is coupled with flag propagation.
So I'd like to the keep the core logic as is.



================
Comment at: lld/ELF/LinkerScript.cpp:1169
     //            .foo : { *(.foo) } }
     // Note: at this point the order of output sections has not been finalized,
     // because orphans have not been inserted into their expected positions. We
----------------
peter.smith wrote:
> I'm not sure I understand the edit here. The function we are in is adjustOutputSections() and it is not called again. There is an adjustSectionsAfterSorting that is called after Orphans are placed.
It's my mistake. It's "*After*", not "*Before*". I'll drop this change.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D118529



More information about the llvm-commits mailing list