From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 15FA6385841A; Wed, 5 Jan 2022 00:25:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 15FA6385841A From: "hjl.tools at gmail dot com" To: glibc-bugs@sourceware.org Subject: [Bug dynamic-link/27924] ld.so: Support DT_RELR relative relocation format Date: Wed, 05 Jan 2022 00:25:15 +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: hjl.tools at gmail dot com X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: security- X-Bugzilla-Changed-Fields: bug_status cc 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: Wed, 05 Jan 2022 00:25:16 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D27924 H.J. Lu changed: What |Removed |Added ---------------------------------------------------------------------------- Status|WAITING |NEW CC| |hjl.tools at gmail dot com --- Comment #11 from H.J. Lu --- The code doesn't work when DT_RELR is enabled in ld.so: Program received signal SIGSEGV, Segmentation fault. 0x00007ffff7639766 in _dlerror_run (operate=3Doperate@entry=3D0xf7639ba0 , args=3Dargs@entry=3D0xffffddb0) at dlerror.c:138 138 int errcode =3D GLRO (dl_catch_error) (&objname, &errstring, &mal= loced, (gdb) p _rtld_local_ro._dl_catch_error $1 =3D (int (*)(const char **, const char **, _Bool *, void (*)(void *),=20 void *)) 0xeffae7f0 (gdb) watch _rtld_local_ro._dl_catch_error Hardware watchpoint 1: _rtld_local_ro._dl_catch_error (gdb) r The program being debugged has been started already. Start it from the beginning? (y or n) y Starting program: /export/build/gnu/tools-build/glibc-gitlab-test/build-x86_64-linux/elf/glob= al --direct BFD: /export/build/gnu/tools-build/glibc-gitlab-test/build-x86_64-linux/elf/ld.s= o: unknown type [0x13] section `.relr.dyn' warning: `/export/build/gnu/tools-build/glibc-gitlab-test/build-x86_64-linux/elf/ld.= so': Shared library architecture unknown is not compatible with target architect= ure i386:x86-64. warning: `/export/build/gnu/tools-build/glibc-gitlab-test/build-x86_64-linux/elf/ld.= so': Shared library architecture unknown is not compatible with target architect= ure i386:x86-64. Hardware watchpoint 1: _rtld_local_ro._dl_catch_error Old value =3D (int (*)(const char **, const char **, _Bool *, void (*)(void= *), void *)) 0x2a7f0 New value =3D (int (*)(const char **, const char **, _Bool *, void (*)(void= *), void *)) 0xf7fec7f0 <_rtld_catch_error> 0x00007ffff7fcffb7 in _dl_start (arg=3D) at rtld.c:572 572 ELF_DYNAMIC_RELOCATE (&bootstrap_map, NULL, 0, 0, 0); (gdb) c Continuing. BFD: /export/build/gnu/tools-build/glibc-gitlab-test/build-x86_64-linux/elf/ld.s= o: unknown type [0x13] section `.relr.dyn' warning: `/export/build/gnu/tools-build/glibc-gitlab-test/build-x86_64-linux/elf/ld.= so': Shared library architecture unknown is not compatible with target architect= ure i386:x86-64. Hardware watchpoint 1: _rtld_local_ro._dl_catch_error Old value =3D (int (*)(const char **, const char **, _Bool *, void (*)(void= *), void *)) 0xf7fec7f0 <_rtld_catch_error> New value =3D (int (*)(const char **, const char **, _Bool *, void (*)(void= *), void *)) 0xeffae7f0 0x00007ffff7fdae3f in _dl_relocate_object (l=3Dl@entry=3D0xf7ff9250 <_rtld_local+2736>, scope=3D, reloc_mode=3Dreloc_mode@entry= =3D0, consider_profiling=3D, consider_profiling@entry=3D0) at dl-reloc.c:288 288 ELF_DYNAMIC_RELOCATE (l, scope, lazy, consider_profiling, skip_ifunc); (gdb)=20 The problem is that ELF_DYNAMIC_DO_RELR is down twice on ld.so. The first time is for RTLD_BOOTSTRAP. It needs to be fixed. --=20 You are receiving this mail because: You are on the CC list for the bug.=