This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: powerpc gold, work around pr17670
- From: Cary Coutant <ccoutant at google dot com>
- To: Binutils <binutils at sourceware dot org>, Cary Coutant <ccoutant at google dot com>
- Date: Wed, 3 Dec 2014 11:19:47 -0800
- Subject: Re: powerpc gold, work around pr17670
- Authentication-results: sourceware.org; auth=none
- References: <20141203151701 dot GR20383 at bubble dot grove dot modra dot org>
> Making the sym undefined can
> be done via override_base() but using that function requires setting
> up an elfcpp::Sym, so I opted for a simpler new Symbol interface.
We already have Symbol::set_undefined(), which currently asserts that
the symbol is predefined. I'd be OK with removing that assert, and
allowing set_undefined() for any symbol. It makes the symbol undefined
by setting source_ to IS_UNDEFINED, but I think that would work for
your purposes -- Symbol::is_undefined() will still return true, so you
should still get the warning from relocate_section(). If not, it could
have two paths -- the existing one for is_predefined_, and one for
FROM_OBJECT symbols that sets u_.from_object.shndx and
is_ordinary_shndx_.
I'd prefer set_undefined() over a more general set_shndx().
> + // Set section index in the relocatable or dynamic object file.
> + void
> + set_shndx(unsigned int shndx)
> + {
> + gold_assert(this->source_ == FROM_OBJECT);
> + this->u_.from_object.shndx = shndx;
> + }
You'd also need to set this->is_ordinary_shndx_ to true to make this
work in general.
-cary