Bind defined symbol locally in PIE

H.J. Lu hjl.tools@gmail.com
Thu Jul 31 15:35:20 GMT 2025


On Mon, Jul 28, 2025 at 9:29 AM Jens Remus <jremus@linux.ibm.com> wrote:
>
> Hello H.J.,
>
> thank you very much for your response!
>
> On 24.07.2025 16:08, H.J. Lu wrote:
> > On Thu, Jul 24, 2025 at 4:04 AM Jens Remus <jremus@linux.ibm.com> wrote:
>
> >> I am porting the x86-64 change from your x86 commit 4e0c91e45402 ("Bind
> >> defined symbol locally in PIE") to s390 for PR 33141.
> >>
> >> The change in elf_x86_64_relocate_section is clear to me.  The change
> >
> > This one checks if input relocation should be copied to output.
> >
> >> to elf_x86_64_check_relocs (now scan_relocs) is not.
> >
> > This one checks if dynamic relocation, which may be generated by linker, not
> > copied from input, is needed.
>
> Ok.  As to my attempt to figure out what this change does, as the other
> architectures did not port that change, by reverting that change on
> master/4e0c91e45402 and not being able to experience any x86 test cases

Codes have been changed significantly on master.    The relevant codes
on master are GENERATE_DYNAMIC_RELOCATION_P and COPY_INPUT_RELOC_P.
Were you saying that changing them didn't cause any regressions on
i386 and x86-64?

> to fail:  Could it be that the change in the check never makes any
> difference?  Or do you otherwise happen to have a suggestion for a test
> case that would show how the change takes effect?
>
> > These 2 are related, but different.
> >
> >> Other architectures that supposedly ported your fix (see list of commits
> >> in forwarded PR update below) did only change relocate_section.
>
> Thanks and regards,
> Jens
> --
> Jens Remus
> Linux on Z Development (D3303)
> +49-7031-16-1128 Office
> jremus@de.ibm.com
>
> IBM
>
> IBM Deutschland Research & Development GmbH; Vorsitzender des Aufsichtsrats: Wolfgang Wendt; Geschäftsführung: David Faller; Sitz der Gesellschaft: Böblingen; Registergericht: Amtsgericht Stuttgart, HRB 243294
> IBM Data Privacy Statement: https://www.ibm.com/privacy/
>


-- 
H.J.


More information about the Binutils mailing list