This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] Exclude zero size section for RELRO segment match
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Alan Modra <amodra at gmail dot com>
- Cc: Binutils <binutils at sourceware dot org>
- Date: Fri, 16 Feb 2018 04:13:04 -0800
- Subject: Re: [PATCH] Exclude zero size section for RELRO segment match
- Authentication-results: sourceware.org; auth=none
- References: <20180215115816.GA17271@gmail.com> <20180216120804.GI3812@bubble.grove.modra.org>
On Fri, Feb 16, 2018 at 4:08 AM, Alan Modra <amodra@gmail.com> wrote:
> On Thu, Feb 15, 2018 at 03:58:16AM -0800, H.J. Lu wrote:
>> When seaching a LOAD segment which overlaps with the RELRO segment, we
>> need to check the size of the last non-zero size section in the LOAD
>> segment.
>
> Why? Do you have a case where the current algorithm goes wrong?
>
Yes, apply this patch and I get assert in
assign_file_positions_for_non_load_sections
on x86-64:
diff --git a/ld/testsuite/ld-elf/binutils.exp b/ld/testsuite/ld-elf/binutils.exp
index 748699d5d1..290f158710 100644
--- a/ld/testsuite/ld-elf/binutils.exp
+++ b/ld/testsuite/ld-elf/binutils.exp
@@ -186,9 +186,11 @@ if { ![istarget "hppa64-*-*"] } {
lappend tls_tests "tdata3" "tbss1" "tbss2" "tbss3"
}
set tls_opts {
- ""
+ "-z noseparate-code"
+ "-z separate-code"
"-z relro"
- "-shared"
+ "-shared -z noseparate-code"
+ "-shared -z separate-code"
"-shared -z relro"
"-z max-page-size=0x100000"
"-z max-page-size=0x100000 -z common-page-size=0x1000"
--
H.J.