V6 [PATCH] x86: Only allow S - A relocations against absolute symbol

H.J. Lu hjl.tools@gmail.com
Thu Apr 2 11:54:29 GMT 2020


On Wed, Apr 1, 2020 at 8:25 PM Alan Modra <amodra@gmail.com> wrote:
>
> Seen here on Ubuntu 18.04 when using a number of different gcc
> versions.
>
> FAIL: Run pr25749-1bb (-no-pie -fno-PIE)
> FAIL: Run pr25749-1bb (-pie -fPIE)
> FAIL: Run pr25749-2ab (-no-pie -fno-PIE)
> FAIL: Run pr25749-2ab (-pie -fPIE)

Ubuntu 18.04 has glibc 2.27 which doesn't have

commit e7feec374c635b6a29d65c39ae5e1855528fed39
Author: Maciej W. Rozycki <macro@mips.com>
Date:   Wed Apr 4 23:09:37 2018 +0100

    elf: Correct absolute (SHN_ABS) symbol run-time calculation [BZ #19818]

    Do not relocate absolute symbols by the base address.  Such symbols have
    SHN_ABS as the section index and their value is not supposed to be
    affected by relocation as per the ELF gABI[1]:

    "SHN_ABS
        The symbol has an absolute value that will not change because of
        relocation."

Glibc 2.28 and above are OK.

-- 
H.J.



More information about the Binutils mailing list