This is the mail archive of the
mailing list for the binutils project.
Re: [PATCH] fix inverted EF_SH_PIC flag on sh/fdpic target
- From: Kaz Kojima <kkojima at rr dot iij4u dot or dot jp>
- To: dalias at libc dot org
- Cc: binutils at sourceware dot org
- Date: Tue, 15 Sep 2015 08:53:10 +0900 (JST)
- Subject: Re: [PATCH] fix inverted EF_SH_PIC flag on sh/fdpic target
- Authentication-results: sourceware.org; auth=none
- References: <20150914175426 dot GA3120 at brightrain dot aerifal dot cx>
Rich Felker <email@example.com> wrote:
> This patch is the result of the discussion and findings in the
> following thread cross-posted with the linux-sh kernel list:
> In short, all of the FDPIC ABI documents (FRV, Blackfin, SH) specify
> their EF_*_PIC flag with exactly the opposite meaning Linux interprets
> it to have. For FRV and Blackfin, binutils matches the kernel behavior
> and therefore produces binaries that run correctly with shared text.
> For SH, however, binutils followed the wrong information in the ABI
> document and therefore produces binaries that gratuitously fail to
> share text at runtime due to their header bits.
> This patch brings the SH behavior into alignment with the kernel and
> other FDPIC targets.
> 2015-09-14 Rich Felker <firstname.lastname@example.org>
> * bfd/elf32-sh.c (sh_elf_relocate_section): Set EF_SH_PIC flag
> instead of clearing it on cross-section relocations.
> (sh_elf_merge_private_data): Clear EF_SH_PIC flag by default.
The patch is OK. I've pushed it with removing preceding bfd/ from
the file name in the ChangeLog entry because bfd has its own ChangeLog
and the file names in the entries should be relative to that directory.
Thanks for the patch and solving this mystery!