This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] ldlang.c: do not warn/error for linker-created empty orphan sections


On 18/12/2018 01.45, Alan Modra wrote:
> 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.

Urgh, sorry about that. OK, that makes it somewhat harder to implement
what I want; I suppose the input sections to each output section would
have to be marked as "placed here by the orphan logic", and then the
warning would have to be postponed until the output phase?

Rasmus

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]