[PATCH] [gold] Implement -z stack-size option

Cary Coutant ccoutant@gmail.com
Wed Aug 24 00:08:00 GMT 2016


>> I'd rename this function to create_stack_segment, since it's no longer
>> just about executable stack info.
>
> Done.
>
>> And it seems to me that it would be cleaner to set the size and
>> alignment directly when creating the segment. I'd just add a new
>> public method Output_segment::set_size_and_alignment(), and call it
>> immediately after calling make_output_segment.
>
> There was already one for alignment, so I just added a set_size method.
> To go with this change, I elided the call to set_offset for PT_GNU_STACK
> rather than making set_offset treat it specially.  Is that what you meant?

Yes.

>> To preserve existing behavior when -z stack-size isn't given,
>> shouldn't we set min_p_align_ only if stack_size() > 0?
>
> That would preserve Gold's existing behavior, which is inconsistent with
> BFD ld's existing behavior.  With my change, Gold's behavior matches BFD
> ld's in all cases (I think).

Sounds good.

This is OK for trunk and 2.27. Thanks!

-cary



More information about the Binutils mailing list