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: [gold patch] Fix problem with alignment of relro sections


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


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