gold plugin: create internal replacement with original linkage first.
authorRafael Espindola <rafael.espindola@gmail.com>
Tue, 7 Oct 2014 03:19:55 +0000 (03:19 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Tue, 7 Oct 2014 03:19:55 +0000 (03:19 +0000)
commit4f17a54bfaafb639cd74250917cad5974b04d69a
tree105790e7d72690044af86e7d3464ac0a5755c69f
parent3ddd4fa0ddf1fb9154a9a171dba58c1a3e551362
gold plugin: create internal replacement with original linkage first.

The call to copyAttributesFrom will copy the visibility, which might assert
if it were to produce something invalid like "internal hidden". We avoid it
by first creating the replacement with the original linkage and then setting
it to internal affter the call to copyAttributesFrom.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219184 91177308-0d34-0410-b5e6-96231b3b80d8
test/tools/gold/Inputs/comdat.ll
test/tools/gold/comdat.ll
tools/gold/gold-plugin.cpp