Implement mechanism to allow explicit sections to be generated on AIX.
Details
Diff Detail
Event Timeline
llvm/lib/MC/MCContext.cpp | ||
---|---|---|
673 | Maybe it's worth to discuss: is there a better way to detect and prevent this case from happening? int b __attribute__((section("a"))) = 2; int a = 3; Right now, I have to add a new field to MCSectionXCOFF to see if the policy matches. Not sure if we could do it without this new field. |
llvm/include/llvm/MC/MCSectionXCOFF.h | ||
---|---|---|
39 | 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 ? | |
llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp | ||
2285 | is there possible, something like ? int b attribute((section("a"))) = 2; |
llvm/include/llvm/MC/MCSectionXCOFF.h | ||
---|---|---|
39 | Anything wrong with the MultiSymbolsAllowed? | |
llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp | ||
2285 | I don't think that would be a problem as they still belongs to different sections. |
llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp | ||
---|---|---|
2088–2100 | /// If this global does not have a custom section, this will be empty and the /// default object file section (.text, .data, etc) will be used. StringRef getSection() const { return hasSection() ? getSectionImpl() : StringRef(); } do we need to check whether the Section Name is empty ? | |
2285 | thanks |
llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp | ||
---|---|---|
2088–2100 | This functionality seems already handled in its caller: TargetLoweringObjectFile::SectionForGlobal, where it would return the default section if hasSection returns false. |
llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp | ||
---|---|---|
2088–2100 | Checked that it's possible for the user to get here with a pragma clang section, so I will report a fatal error as a limitation for now. |
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 ?