[gold patch] Fix problem with alignment of relro sections
Ian Lance Taylor
iant@google.com
Fri Oct 15 23:18:00 GMT 2010
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
More information about the Binutils
mailing list