[PATCH] D68147: [MC][ELF] Prevent globals with an explicit section from being mergeable by default and add a safe option to allow mergeable

ben via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 27 10:53:32 PDT 2019


bd1976llvm created this revision.
Herald added subscribers: llvm-commits, cfe-commits, hiraditya.
Herald added projects: clang, LLVM.

Alternative to https://reviews.llvm.org/D68101

Prevents globals with an explicit section from being mergeable by default (as in D68101 <https://reviews.llvm.org/D68101>).
Adds a command line option to allow the explicit section to be mergeable; but, an error will be emitted if broken output would be created.
Users can use the command line option if the default behaviour results in a performance regression.

This is a partial fix for https://bugs.llvm.org/show_bug.cgi?id=43457.


Repository:
  rC Clang

https://reviews.llvm.org/D68147

Files:
  clang/include/clang/Basic/CodeGenOptions.def
  clang/include/clang/Driver/Options.td
  clang/lib/CodeGen/BackendUtil.cpp
  clang/lib/Driver/ToolChains/Clang.cpp
  clang/lib/Driver/ToolChains/CommonArgs.cpp
  clang/lib/Frontend/CompilerInvocation.cpp
  llvm/include/llvm/CodeGen/CommandFlags.inc
  llvm/include/llvm/Target/TargetMachine.h
  llvm/include/llvm/Target/TargetOptions.h
  llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
  llvm/lib/Target/TargetLoweringObjectFile.cpp
  llvm/test/CodeGen/X86/explict-section-mergeable.ll
  llvm/test/CodeGen/X86/section_mergeable_size.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D68147.222200.patch
Type: text/x-patch
Size: 13678 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190927/875ebb7b/attachment.bin>


More information about the llvm-commits mailing list