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

Joerg Sonnenberger via llvm-commits llvm-commits at lists.llvm.org
Sat Mar 12 05:00:41 PST 2016


On Sat, Mar 12, 2016 at 09:17:46AM +0000, George Rimar via llvm-commits wrote:
> 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

This is explicitly going to break Fortran programs and I don't think it
generally adds much value.

Joerg


More information about the llvm-commits mailing list