diff options
author | Zaara Syeda <95926691+syzaara@users.noreply.github.com> | 2024-01-31 16:34:21 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-31 16:34:21 -0500 |
commit | a03a6e99647318a86ea398c42e241da43e3c550e (patch) | |
tree | de24a12fd36be7ea49851f28fe412b201b877db6 /llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp | |
parent | 22773e591fc3e585a32f8122eb203e50fcc1e441 (diff) | |
download | llvm-a03a6e99647318a86ea398c42e241da43e3c550e.zip llvm-a03a6e99647318a86ea398c42e241da43e3c550e.tar.gz llvm-a03a6e99647318a86ea398c42e241da43e3c550e.tar.bz2 |
[AIX] [XCOFF] Add support for common and local common symbols in the TOC (#79530)
This patch adds support for common and local symbols in the TOC for AIX.
Note that we need to update isVirtualSection so as a common symbol in
TOC will have the symbol type XTY_CM and will be initialized when placed
in the TOC so sections with this type are no longer virtual.
---------
Co-authored-by: Zaara Syeda <syzaara@ca.ibm.com>
Diffstat (limited to 'llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp')
-rw-r--r-- | llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp index a69b714..b0cdd63 100644 --- a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp +++ b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp @@ -2424,8 +2424,10 @@ MCSection *TargetLoweringObjectFileXCOFF::SelectSectionForGlobal( if (GVar->hasAttribute("toc-data")) { SmallString<128> Name; getNameWithPrefix(Name, GO, TM); + XCOFF::SymbolType symType = + GO->hasCommonLinkage() ? XCOFF::XTY_CM : XCOFF::XTY_SD; return getContext().getXCOFFSection( - Name, Kind, XCOFF::CsectProperties(XCOFF::XMC_TD, XCOFF::XTY_SD), + Name, Kind, XCOFF::CsectProperties(XCOFF::XMC_TD, symType), /* MultiSymbolsAllowed*/ true); } |