[PATCH] D17998: [ELF] implement --warn-common/--no-warn-common

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Sat Mar 12 01:17:46 PST 2016


grimar added a comment.

In http://reviews.llvm.org/D17998#373261, @ruiu wrote:

> What about the Joerg's comment? Doesn't this always warn on two common symbol who have the same name?


Yea, I answered already via llvm-mails, but will duplicate answer here for history of patch.
Current logic always warn about such symbols. I did that intentionaly because gold do the same, 
consider 2 files:

test.s:

  .globl _start
  _start:
  
  .type arr, at object
  .comm arr,4,4

test2.s:

  .type arr, at object
  .comm arr,4,4

So 2 commons have the same size and gold produces a warning in that case:
++ /home/LLVM/build/bin/llvm-mc -filetype=obj test.s -o test.o
++ /home/LLVM/build/bin/llvm-mc -filetype=obj test2.s -o test2.o
++ gold -warn-common test.o test2.o -o test
gold: warning: test2.o: multiple common of 'arr'
gold: test.o: previous definition here


http://reviews.llvm.org/D17998





More information about the llvm-commits mailing list