This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] PR ld/16322: ld fails to generate GNU_RELRO segment
- From: Richard Sandiford <rdsandiford at googlemail dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: Hans-Peter Nilsson <hans-peter dot nilsson at axis dot com>, Binutils <binutils at sourceware dot org>, Nick Clifton <nickc at redhat dot com>
- Date: Mon, 20 Jan 2014 21:28:14 +0000
- Subject: Re: [PATCH] PR ld/16322: ld fails to generate GNU_RELRO segment
- Authentication-results: sourceware.org; auth=none
- References: <CAMe9rOqOcpCR3=E694mSoc+3=jOXs9gf8=Bt5QuJzYDK8U2Cvw at mail dot gmail dot com> <201401091901 dot s09J15Ef025879 at ignucius dot se dot axis dot com> <CAMe9rOqc0kmn4BeVsKyQQ5h34szhJXMXaHmDmHoyD4K55bqL8w at mail dot gmail dot com>
[catching up on mail]
"H.J. Lu" <hjl.tools@gmail.com> writes:
> On Thu, Jan 9, 2014 at 11:01 AM, Hans-Peter Nilsson
> <hans-peter.nilsson@axis.com> wrote:
>>> On Thu, Jan 9, 2014 at 10:51 AM, Hans-Peter Nilsson
>>> <hans-peter.nilsson@axis.com> wrote:
>>
>>> > Also, ia64-linux will fail.
>>
>> And the latest change also made mipsisa32r2el-unknown-linux-gnu
>> fail (i.e. likely any mips-linux) where it had clean results
>> before:
>>
>> Running /tmp/hpautotest-binutils/bsrc/src/ld/testsuite/ld-elf/binutils.exp ...
>> FAIL: objcopy -shared -z relro (tbss1)
>> FAIL: objcopy -shared -z relro (tbss2)
>> FAIL: objcopy -shared -z relro (tbss3)
>>
>
> I believe those are mips bugs. Mips linker also generates
> NULL segment:
>
> Program Headers:
> Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align
> REGINFO 0x000114 0x00000114 0x00000114 0x00018 0x00018 R 0x4
> LOAD 0x000000 0x00000000 0x00000000 0x00330 0x00330 R E 0x10000
> LOAD 0x000c00 0x00010c00 0x00010c00 0x00408 0x00408 RW 0x10000
> DYNAMIC 0x00012c 0x0000012c 0x0000012c 0x00098 0x00098 RWE 0x4
> TLS 0x000c00 0x00010c00 0x00010c00 0x00001 0x00800 R 0x400
> GNU_RELRO 0x000c00 0x00010c00 0x00010c00 0x00400 0x00400 R 0x1
> NULL 0x000000 0x00000000 0x00000000 0x00000 0x00000 0x4
>
> before my change.
The NULL segment is deliberate: it's added for use by the prelinker.
Thanks,
Richard