From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 692D13860C37; Thu, 27 May 2021 19:01:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 692D13860C37 From: "i at maskray dot me" To: glibc-bugs@sourceware.org Subject: [Bug dynamic-link/27924] ld.so: Support DT_RELR relative relocation format Date: Thu, 27 May 2021 19:01:46 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: dynamic-link X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: i at maskray dot me 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 X-BeenThere: glibc-bugs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Glibc-bugs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 May 2021 19:01:46 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D27924 --- Comment #1 from Fangrui Song --- It is probably well-known that position independent executables have many relative relocations. If the Distribution adopts -Bsymbolic-non-weak-functions (safer alternative -Bsymbolic-functions which respects pointer equality for C++ vague linkage definitions), shared objects can benefit a lot as well https://sourceware.org/bugzilla/show_bug.cgi?id=3D27871 Here is an example of libLLVM-13git.so # -Bsymbolic-functions (-Bsymbolic-non-weak-functions is similar since -fvisibility-inlines-hidden is already used) % llvm-readelf -WS symbolic.so | egrep 'Nr|\.rel[ar]' [Nr] Name Type Address Off Size ES = Flg Lk Inf Al [ 8] .rela.dyn RELA 00000000003c8d60 3c8d60 27d368 18 = A=20 1 0 8 [ 9] .rela.plt RELA 00000000006460c8 6460c8 0020a0 18 = AI=20 1 25 8 # -Bsymbolic-functions --pack-dyn-relocs=3Drelr % llvm-readelf -WS relr.so | egrep 'Nr|\.rel[ar]'=20=20=20=20 [Nr] Name Type Address Off Size ES = Flg Lk Inf Al [ 8] .rela.dyn RELA 00000000003c8d60 3c8d60 016bd8 18 = A=20 1 0 8 [ 9] .relr.dyn RELR 00000000003df938 3df938 007ba8 08 = A=20 0 0 8 [10] .rela.plt RELA 00000000003e74e0 3e74e0 0020a0 18 = AI=20 1 26 8 --=20 You are receiving this mail because: You are on the CC list for the bug.=