[PATCH] D46874: [MC] - Add .stack_size sections into groups and link them with .text
George Rimar via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu May 24 02:12:45 PDT 2018
grimar added a comment.
In https://reviews.llvm.org/D46874#1110730, @jhenderson wrote:
> In https://reviews.llvm.org/D46874#1109615, @grimar wrote:
>
> > What I can probably do is to compute ID based on the .text section name.
> >
> > So that for no -ffunction-sections case it would emit several .stack_sizes with the same ID and so that final object would contain only a single section finally after merging them,
> > just like we would want.
> >
> > It would work for my sample case too I think. Let me try to implement this.
>
>
> Yes, I think this all makes sense. Here's a summary of what I think is best without -function-sections enabled:
>
> // These two share a .stack_sizes section
> void func1() {}
> void func2() {}
>
> // These two share a different .stack_sizes section.
> void func3() __attribute__ ((section (".text.other"))) {}
> void func4() __attribute__ ((section (".text.other"))) {}
>
> // This has it's own .stack_sizes section in its group
> template <int I> int func5() { return I; }
>
>
>
Yep. The latest diff implements exactly this behavior I believe.
https://reviews.llvm.org/D46874
More information about the llvm-commits
mailing list