This is the mail archive of the
mailing list for the binutils project.
Re: [PATCH] [gold] Implement -z stack-size option
- From: Cary Coutant <ccoutant at gmail dot com>
- To: Roland McGrath <mcgrathr at google dot com>
- Cc: "binutils at sourceware dot org" <binutils at sourceware dot org>
- Date: Tue, 23 Aug 2016 17:08:53 -0700
- Subject: Re: [PATCH] [gold] Implement -z stack-size option
- Authentication-results: sourceware.org; auth=none
- References: <CAB=4xhpnjC32A2LTiroat_S6jy4gefAz_PRa_94J1-8eoB1iUw@mail.gmail.com> <CAJimCsEUyTJe3iM-MfXY-uMYVdYQnaVzxuKLwmu8GPrzEzn8email@example.com> <CAB=4xhoKGFRwL=zJ2p1Ri7BWyBNGxm6Y7KstVNyehDOd9iJNcw@mail.gmail.com>
>> I'd rename this function to create_stack_segment, since it's no longer
>> just about executable stack info.
>> 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?
>> 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).
This is OK for trunk and 2.27. Thanks!