[PATCH] D143745: Make section attribute and -ffunction-sections play nicely

Fangrui Song via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 10 23:33:34 PST 2023


MaskRay added a comment.

If one TU has more than one section of the same name, there is no guarantee they are adjacent after linking. Linker scripts and `--shuffle-sections` can adjust them.
I don't mind a behavior change if GCC is willing to do the same. But without, it's safer to use an option.

Created a feature request for GCC: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108761


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

https://reviews.llvm.org/D143745



More information about the cfe-commits mailing list