[PATCH] D88493: [XCOFF] Use -data-sections=true as default for llc on AIX

Jason Liu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 29 08:11:30 PDT 2020


jasonliu created this revision.
jasonliu added reviewers: daltenty, hubert.reinterpretcast, DiggerLin.
Herald added subscribers: llvm-commits, dexonsmith, hiraditya, nemanjai.
Herald added a project: LLVM.
jasonliu requested review of this revision.
Herald added a subscriber: aheejin.

Variables with common linkage will be emitted as a common-type csect in XCOFF. Per the assembly reference:
"Several modules can share the same common block. If any of those modules have an external Control Section (csect) with the same name and the csect with the same name has a storage mapping class other than BS or UC, then the common block is initialized and becomes that other Control Section.”

Initialization via a non-csect (i.e label-ed data) is an undefined behaviour on AIX platform, and results in a linker warning.
Therefore, we want to turn on -data-sections by default on AIX. User could still use -fdata-sections=false if they understand the potential risks.


https://reviews.llvm.org/D88493

Files:
  llvm/include/llvm/ADT/Triple.h
  llvm/include/llvm/Target/TargetMachine.h
  llvm/include/llvm/Target/TargetOptions.h
  llvm/lib/CodeGen/CommandFlags.cpp
  llvm/test/CodeGen/PowerPC/aix-alias.ll
  llvm/test/CodeGen/PowerPC/aix-extern-weak.ll
  llvm/test/CodeGen/PowerPC/aix-extern.ll
  llvm/test/CodeGen/PowerPC/aix-readonly-with-relocation.ll
  llvm/test/CodeGen/PowerPC/aix-reference-func-addr-const.ll
  llvm/test/CodeGen/PowerPC/aix-return55.ll
  llvm/test/CodeGen/PowerPC/aix-weak.ll
  llvm/test/CodeGen/PowerPC/aix-xcoff-data.ll
  llvm/test/CodeGen/PowerPC/aix-xcoff-lower-comm.ll
  llvm/test/CodeGen/PowerPC/aix-xcoff-mergeable-const.ll
  llvm/test/CodeGen/PowerPC/aix-xcoff-mergeable-str.ll
  llvm/test/CodeGen/PowerPC/aix-xcoff-reloc.ll
  llvm/test/CodeGen/PowerPC/aix-xcoff-rodata.ll
  llvm/test/CodeGen/PowerPC/aix-xcoff-symbol-rename.ll
  llvm/test/CodeGen/PowerPC/aix-xcoff-used.ll
  llvm/test/CodeGen/PowerPC/aix-xcoff-visibility.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D88493.294996.patch
Type: text/x-patch
Size: 21617 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200929/ca6aa307/attachment.bin>


More information about the llvm-commits mailing list