From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1791) id 4C762386F43F; Tue, 21 Apr 2020 18:12:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4C762386F43F Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Adhemerval Zanella To: glibc-cvs@sourceware.org Subject: [glibc] elf: Support lld-style link map for librtld.map X-Act-Checkin: glibc X-Git-Author: Fangrui Song X-Git-Refname: refs/heads/master X-Git-Oldrev: 566e10aa7292bacd74d229ca6f2cd9e8c8ba8748 X-Git-Newrev: eb06601bb4187d8f5a9f55c2d212747869f63fe1 Message-Id: <20200421181227.4C762386F43F@sourceware.org> Date: Tue, 21 Apr 2020 18:12:27 +0000 (GMT) X-BeenThere: glibc-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Glibc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Apr 2020 18:12:27 -0000 https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=eb06601bb4187d8f5a9f55c2d212747869f63fe1 commit eb06601bb4187d8f5a9f55c2d212747869f63fe1 Author: Fangrui Song Date: Tue Apr 21 13:28:42 2020 -0300 elf: Support lld-style link map for librtld.map GNU ld and gold's -Map include a line like: path/to/build/libc_pic.a(check_fds.os) lld -Map does not have the archive member list, but we can still derive the members from the following output VMA LMA Size Align Out In Symbol ... 1a1c0 1a1c0 e2 16 path/to/build/libc_pic.a(check_fds.os):(.text) Diff: --- elf/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/elf/Makefile b/elf/Makefile index 9b1d58c7ad..6919e53c14 100644 --- a/elf/Makefile +++ b/elf/Makefile @@ -514,9 +514,10 @@ $(objpfx)librtld.map: $(objpfx)dl-allobjs.os $(common-objpfx)libc_pic.a rm -f $@.o mv -f $@T $@ +# For lld, skip preceding addresses and values before matching the archive and the member. $(objpfx)librtld.mk: $(objpfx)librtld.map Makefile LC_ALL=C \ - sed -n 's@^$(common-objpfx)\([^(]*\)(\([^)]*\.os\)) *.*$$@\1 \2@p' \ + sed -n 's@^[0-9a-f ]*$(common-objpfx)\([^(]*\)(\([^)]*\.os\)) *.*$$@\1 \2@p' \ $< | \ while read lib file; do \ case $$lib in \