[PATCH] D88615: [XCOFF] Enable explicit sections on AIX
Jason Liu via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 7 10:13:54 PDT 2020
jasonliu added inline comments.
================
Comment at: llvm/include/llvm/MC/MCSectionXCOFF.h:39
StringRef SymbolTableName;
+ bool MultiSymbolsAllowed;
static constexpr unsigned DefaultAlignVal = 4;
----------------
DiggerLin wrote:
> Using MultiSymbolsAllowed to represent whether the section is generated for separate function or separated data variable when -function-section or -data-section .
>
> what about to change the MultiSymbolsAllowed to IsSymbolNameAsSectionName ?
Anything wrong with the `MultiSymbolsAllowed`?
`IsSymbolNameAsSectionName` does not really convey what we want. As you could have
int a __attribute__((section("a"))) = 2;
And the symbol name is the same with section name, but I assume we don't want `true` here.
================
Comment at: llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp:2285
+ Func->isDeclaration() ? XCOFF::XTY_ER : XCOFF::XTY_SD,
+ SectionKind::getText())
->getQualNameSymbol();
----------------
DiggerLin wrote:
> is there possible, something like ?
>
> int b __attribute__((section("a"))) = 2;
> void a(void) {
> }
> and compile with -function-section?
I don't think that would be a problem as they still belongs to different sections.
`b` would belong to `a[RW]`
and function `a` would belong to `a[PR]`
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D88615/new/
https://reviews.llvm.org/D88615
More information about the llvm-commits
mailing list