[PATCH] D13188: [MachO] Stop generating *coal* sections.

Akira Hatanaka via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 25 19:33:50 PDT 2015


ahatanak created this revision.
ahatanak added a subscriber: llvm-commits.

Some background on why we don't have to use *coal* sections anymore:
Long ago when C++ was new and "weak" had not been standardized, an attempt was made in cctools to support C++ inlines that can be coalesced by putting them into their own section (__TEXT/__textcoal_nt instead of __TEXT/__text).  

The current macho linker supports the weak-def bit on any symbol to allow it to be coalesced, but the compiler still puts weak-def functions/data into alternate section names, which the linker must map back to the base section name.


This patch makes changes that are necessary to prevent the compiler and asssembler from using the "coal" sections and have them use the base sections instead when the target architecture is not powerpc:

__TEXT/__textcoal_nt   instead use  __TEXT/__text
__TEXT/__const_coal    instead use  __TEXT/__const
__DATA/__datacoal_nt   instead use  __DATA/__data

If the target is powerpc, we continue to use the *coal* sections since anyone targeting powerpc is probably using an old linker that doesn't have support for the weak-def bits.

http://reviews.llvm.org/D13188

Files:
  include/llvm/MC/MCContext.h
  lib/MC/MCContext.cpp
  lib/MC/MCObjectFileInfo.cpp
  test/CodeGen/PowerPC/coal-sections.ll
  test/CodeGen/X86/coal-sections.ll
  test/CodeGen/X86/global-sections.ll
  test/MC/MachO/coal-sections-powerpc.s
  test/MC/MachO/coal-sections-x86_64.s
  test/MC/MachO/weakdef.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D13188.35791.patch
Type: text/x-patch
Size: 13198 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150926/255de71f/attachment.bin>


More information about the llvm-commits mailing list