From 2756a25828e5a0ccdbaa54dd92b44a69a5f2ee30 Mon Sep 17 00:00:00 2001 From: Cary Coutant Date: Wed, 10 Dec 2008 19:50:14 +0000 Subject: [PATCH] * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement object to override a kept COMDAT group from a plugin object. --- gold/ChangeLog | 5 +++++ gold/layout.cc | 9 +++++++++ 2 files changed, 14 insertions(+) diff --git a/gold/ChangeLog b/gold/ChangeLog index dbfe8f636db..85482bb20e7 100644 --- a/gold/ChangeLog +++ b/gold/ChangeLog @@ -1,3 +1,8 @@ +2008-12-10 Cary Coutant + + * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement + object to override a kept COMDAT group from a plugin object. + 2008-12-09 Ian Lance Taylor PR 7088 diff --git a/gold/layout.cc b/gold/layout.cc index 2097b6de7df..a4f17e53557 100644 --- a/gold/layout.cc +++ b/gold/layout.cc @@ -47,6 +47,7 @@ #include "reloc.h" #include "descriptors.h" #include "layout.h" +#include "plugin.h" namespace gold { @@ -2959,6 +2960,14 @@ Layout::add_comdat(Relobj* object, unsigned int shndx, if (ins.first->second.group_) { // We've already seen a real section group with this signature. + // If the kept group is from a plugin object, and we're in + // the replacement phase, accept the new one as a replacement. + if (ins.first->second.object_ == NULL + && parameters->options().plugins()->in_replacement_phase()) + { + ins.first->second = kept; + return true; + } return false; } else if (group) -- 2.30.2