in this patch we put the global variable in a Csect which's SectionKind is "ReadOnlyWithRel" into Data Section.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp | ||
---|---|---|
1873–1876 | Please add a TODO for putting this under option control. The user may want to have read-only data with relocations placed into a read-only section by the compiler. There are linker options, such as -Wl,-bforceimprw (which would make sense to use alongside -fdata-sections), that support such cases. |
llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp | ||
---|---|---|
1874 | s/maybe/may ? | |
llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp | ||
1639 | Considering this if clause is going longer when we support more GVKind, does that make sense to make the code cleaner by having a helper function like isValidGVKind? | |
llvm/test/CodeGen/PowerPC/aix-readonly-relocation.ll | ||
1 ↗ | (On Diff #237344) | I kinda feel the testcase name is a little misleading, is that better to call it aix-readonly-with-relocation.ll? |
llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp | ||
---|---|---|
1874 | thanks,fixed | |
llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp | ||
1639 | I do not think we need to add helper function here, I changed to simple condition. thank for let me to consider a simple one. | |
llvm/test/CodeGen/PowerPC/aix-readonly-relocation.ll | ||
1 ↗ | (On Diff #237344) | changed |
llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp | ||
---|---|---|
1874 | I'm still seeing "maybe". When saying something is fixed, please be clear if the fixed version is not being posted "immediately". |
llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp | ||
---|---|---|
1876 | Is seems SectionKind::isGlobalWriteableData should be updated in the case where we generate ReadOnlyWithRel as read-only unless if we find that the SectionKind is what we should change in that case. |
llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp | ||
---|---|---|
1876 |
|
llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp | ||
---|---|---|
1876 | sorry , it should be I am not sure for other OS(not xcoff) |
llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp | ||
---|---|---|
1873–1876 | and if we put the ReadOnlyWithRel as read-only section. I think the function bool isReadOnly() const { return K == ReadOnly || isMergeableCString() || isMergeableConst(); } also need to be modified. We can put the change of SectionKind::isGlobalWriteableData() and isReadOnly() in the same new patch later. |
LGTM with just the fix to replace the "maybe"s. What we should do for the later TODO can be determined later.
s/maybe/may ?