From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 45AF13858C50; Fri, 14 Oct 2022 12:16:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 45AF13858C50 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1665749796; bh=hlT3s3aEesW4t1flw0jUl1u/FzeMg4a6i1DiOAc3JjA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ZHX0xA9phc2n74ldy0bDVlQ8MIqOhawsTznzySozv+3yxJcnuH5StGpnk6BFjfZHx KxSTNPorYSfO+yhz0TI8gad1zvheO4RSpWyb8GSY7nMqpZuN8V7RoAMCUmQIoXJunY TXCH0sdogewrzttTHDsPf0ZoTUmBVhEKxcAyna40= From: "adhemerval.zanella at linaro dot org" To: glibc-bugs@sourceware.org Subject: [Bug libc/29651] glibc can't handle IRELATIVE in .rel.plt only on ARM32 and PPC Date: Fri, 14 Oct 2022 12:16:35 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: libc X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: adhemerval.zanella at linaro dot org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D29651 --- Comment #3 from Adhemerval Zanella --- Since IFUNC support was added in a most ad-hoc way for each architecture, t= here is no unified code to generate it with binutils or to handle on glibc. We can implement your suggestion and add support for .rel.plt IRELATIVE handling on arm and PPC, however it will only work for linkes that implemen= t it and there will be issues on how to avoid such binaries to run on older glib= cs.=20 The glibc now avoids random failures if there is missing support and instead dumps an error on why it has failed. So essentially this change for ARM and PPC will be similar to what we have = done for DT_RELR: we will need the static linker to advertise that IFUNC is now placed on .rel.plt instead of .rel.dyn so glibc can avoid starting the bina= ry if it has no support. For DT_RELR both binutils and lld now add an extra version tag GLIBC_ABI_DT_RELR on .gnu.version_r to indicate it. For instan= ce on a glibc binary built with DT_RELR support: Version needs section '.gnu.version_r' contains 1 entry: Addr: 0x0000000000000998 Offset: 0x000998 Link: 7 (.dynstr) 000000: Version: 1 File: libc.so.6 Cnt: 4 0x0010: Name: GLIBC_ABI_DT_RELR Flags: none Version: 5 0x0020: Name: GLIBC_2.4 Flags: none Version: 4 0x0030: Name: GLIBC_2.34 Flags: none Version: 3 0x0040: Name: GLIBC_2.2.5 Flags: none Version: 2 Older glibcs will fails with a missing GLIBC_ABI_DT_RELR version trying to = bind the version. So if we want to add support for IRELATE on .rel.plt for ARM and PPC we nee= d a similar change, where static linkers add a GLIBC_ABI_IFUNC_REL_PLT version = tag. --=20 You are receiving this mail because: You are on the CC list for the bug.=