This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] ldlang.c: do not warn/error for linker-created empty orphan sections
- From: Alan Modra <amodra at gmail dot com>
- To: Rasmus Villemoes <rasmus dot villemoes at prevas dot dk>
- Cc: "binutils at sourceware dot org" <binutils at sourceware dot org>, Rasmus Villemoes <Rasmus dot Villemoes at prevas dot se>
- Date: Tue, 18 Dec 2018 11:15:08 +1030
- Subject: Re: [PATCH] ldlang.c: do not warn/error for linker-created empty orphan sections
- References: <20181217224157.28003-1-rasmus.villemoes@prevas.dk>
On Mon, Dec 17, 2018 at 10:42:07PM +0000, Rasmus Villemoes wrote:
> --- a/ld/ldlang.c
> +++ b/ld/ldlang.c
> @@ -6710,7 +6710,8 @@ ldlang_place_orphan (asection *s)
> const char *name = s->name;
> int constraint = 0;
>
> - if (config.orphan_handling == orphan_handling_error)
> + if (config.orphan_handling == orphan_handling_error &&
> + !((s->flags & SEC_LINKER_CREATED) && s->size == 0))
> einfo (_("%X%P: error: unplaced orphan section `%pA' from `%pB'\n"),
> s, s->owner);
>
I agree with your intent here, namely that you do want to continue
emitting an error/warning for non-zero sized linker created orphans.
Unfortunately, this patch doesn't do that, because linker created
sections typically won't be sized until later in the linking process.
--
Alan Modra
Australia Development Lab, IBM