This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH][BZ #21779] Resolve non-relocatable branch in MicroBlaze pt-vfork.S
- From: Adhemerval Zanella <adhemerval dot zanella at linaro dot org>
- To: libc-alpha at sourceware dot org
- Date: Mon, 17 Jul 2017 15:42:42 -0300
- Subject: Re: [PATCH][BZ #21779] Resolve non-relocatable branch in MicroBlaze pt-vfork.S
- Authentication-results: sourceware.org; auth=none
- References: <20170717125808.6920-1-nathan@nathanrossi.com>
On 17/07/2017 09:58, Nathan Rossi wrote:
> The relative branch directly to __libc_vfork results in an relocation
> that cannot be resolved. Specifically a R_MICROBLAZE_64_PCREL relocation
> is created for this branch, however for MicroBlaze R_MICROBLAZE_64_PCREL
> type relocations symbols are not resolved. Additionally due to the
> branch being located in the .text section the instruction cannot be
> rewritten as the section is not writable, and causes a segfault at
> runtime when loading libpthread.
>
> To resolve this issue, ensure the branch is done using PLT. This removes
> the need to modify the instruction and trades the R_MICROBLAZE_64_PCREL
> for a more common R_MICROBLAZE_JUMP via the PLT.
>
> 2017-07-17 Nathan Rossi <nathan@nathanrossi.com>
>
> [BZ #21779]
> * sysdeps/unix/sysv/linux/microblaze/pt-vfork.S: Branch using PLT
LGTM, cross make clean shows no regression. Since you seem to have access
to a microblaze ystem, it would be useful if you have time to run the
complete make check so we can update the 2.26 release wike [1].
[1] https://sourceware.org/glibc/wiki/Release/2.26
> ---
> sysdeps/unix/sysv/linux/microblaze/pt-vfork.S | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/sysdeps/unix/sysv/linux/microblaze/pt-vfork.S b/sysdeps/unix/sysv/linux/microblaze/pt-vfork.S
> index f201f0429f..d8339f21f7 100644
> --- a/sysdeps/unix/sysv/linux/microblaze/pt-vfork.S
> +++ b/sysdeps/unix/sysv/linux/microblaze/pt-vfork.S
> @@ -34,7 +34,7 @@
> || SHLIB_COMPAT (libpthread, GLIBC_2_1_2, GLIBC_2_20))
>
> ENTRY (vfork_compat)
> - bri __libc_vfork
> + bri __libc_vfork@PLT
> END (vfork_compat)
>
> #endif
>