This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [gold patch] Fix problem with alignment of relro sections
- From: Ian Lance Taylor <iant at google dot com>
- To: Cary Coutant <ccoutant at google dot com>
- Cc: Binutils <binutils at sourceware dot org>, Doug Kwan <dougkwan at google dot com>
- Date: Fri, 15 Oct 2010 16:18:34 -0700
- Subject: Re: [gold patch] Fix problem with alignment of relro sections
- References: <AANLkTin9zRMVX0c6VSJxmfRwc-NNB+ZaQY6sLcBqw2nT@mail.gmail.com>
Cary Coutant <ccoutant@google.com> writes:
> * layout.cc (Layout::set_segment_offsets): Don't try to realign data
> segment that has been aligned for relro.
> * output.cc (Output_segment::set_section_addresses): Change signature;
> adjust all callers. Account for alignment when totalling
> size of relro sections.
> * output.h (Output_segment::set_section_addresses): Change signature.
> * testsuite/Makefile.am (relro_test.sh, relro_test.stdout): New
> targets.
> * testsuite/Makefile.in: Regenerate.
> * testsuite/relro_test.cc: Add alignment attributes to test proper
> alignment of relro sections when padding is necessary.
> * testsuite/relro_test.sh: New script.
> --- output.cc 25 Aug 2010 08:36:54 -0000 1.134
> +++ output.cc 15 Oct 2010 18:58:26 -0000
> @@ -3662,12 +3662,14 @@ Output_segment::has_dynamic_reloc_list(c
> uint64_t
> Output_segment::set_section_addresses(const Layout* layout, bool reset,
> uint64_t addr,
> - unsigned int increase_relro,
> + unsigned int* pincrease_relro,
> + bool* has_relro,
> off_t* poff,
> unsigned int* pshndx)
> {
The function comment should explain PINCREASE_RELRO and HAS_RELRO.
PINCREASE_RELRO is a bit subtle.
This is OK with those changes.
Thanks for tracking this down.
Ian