This is the mail archive of the 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: [PATCH] fix inverted EF_SH_PIC flag on sh/fdpic target

Rich Felker <> 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  <>
> 	* 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!


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