This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc 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]

[PATCH v1] Fix elf_irel for static-pie


Currently, elf_irel does not account for the load address in case of
static-pie. This change makes _dl_relocate_static_pie return the load
address, which is then passed to elf_irel so that it can adjust for the
load address.

I do not know of any released linker which can exercise this correctly
that I can write tests.

ChangeLog:

        * csu/libc-start.c (apply_irel): Add new argument load_addr.
        (LIBC_START_MAIN): Pass return value from _dl_relocate_static_pie
        to ARCH_SETUP_IREL.
        * csu/static-reloc.c (_dl_relocate_static_pie): Return 0.
        * elf/dl-reloc-static-pie.c (_dl_relocate_static_pie): Return
        load address.
        * sysdeps/generic/ldsodefs.h (_dl_relocate_static_pie): Add
        ElfW(Addr) as return type.
        * sysdeps/generic/libc-start.h (ARCH_SETUP_IREL): Add load_addr
        argument.
        * sysdeps/mach/hurd/libc-start.h (ARCH_SETUP_IREL): Likewise.
        * sysdeps/unix/sysv/linux/powerpc/libc-start.h (ARCH_SETUP_IREL):
        Likewise.
        * sysdeps/x86/libc-start.h (ARCH_SETUP_IREL): Likewise.
        * sysdeps/x86_64/dl-irel.h (elf_irela): Add new argument load_addr.

Attachment: elf_irel_patch_v1
Description: Binary data


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