From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by sourceware.org (Postfix) with ESMTP id E7C3C384A033 for ; Mon, 1 Feb 2021 13:43:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org E7C3C384A033 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-424-aLORxCqYMfGn70TWDiA_pQ-1; Mon, 01 Feb 2021 08:43:18 -0500 X-MC-Unique: aLORxCqYMfGn70TWDiA_pQ-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id BB26F107ACE6; Mon, 1 Feb 2021 13:43:17 +0000 (UTC) Received: from oldenburg.str.redhat.com (ovpn-113-35.ams2.redhat.com [10.36.113.35]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B1120100AE35; Mon, 1 Feb 2021 13:43:16 +0000 (UTC) From: Florian Weimer To: Fangrui Song via Libc-alpha Cc: Adhemerval Zanella , Fangrui Song Subject: Re: [PATCH v2] elf: Replace a --defsym trick with an object file to be compatible with LLD References: <56de4bc0-05b1-49f9-32ce-b9eab7fdc510@linaro.org> <20210129192824.804615-1-maskray@google.com> Date: Mon, 01 Feb 2021 14:43:14 +0100 In-Reply-To: <20210129192824.804615-1-maskray@google.com> (Fangrui Song via Libc-alpha's message of "Fri, 29 Jan 2021 11:28:24 -0800") Message-ID: <874kivrjil.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-6.6 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Feb 2021 13:43:22 -0000 * Fangrui Song via Libc-alpha: > $(objpfx)librtld.map: $(objpfx)dl-allobjs.os $(common-objpfx)libc_pic.a > @-rm -f $@T > - $(reloc-link) -o $@.o $(rtld-stubbed-symbols-args) \ > - '-Wl,-(' $^ -lgcc '-Wl,-)' -Wl,-Map,$@T > - rm -f $@.o > + printf '$(patsubst %,.globl %\n,$(rtld-stubbed-symbols)) $(patsubst %,%:\n,$(rtld-stubbed-symbols))' | \ > + $(CC) -o $@T.o $(ASFLAGS) -c -x assembler - > + $(reloc-link) -o $@.o $@T.o '-Wl,-(' $^ -lgcc '-Wl,-)' -Wl,-Map,$@T > + rm -f %@T.o $@.o > mv -f $@T $@ It may be a little bit cleaner to replace the shell/make mix with just shell, like (untested): for symbol in $(rtld-stubbed-symbols) ; do \ echo ".globl $$symbol" ; \ echo "$$symbol:" ; \ done | $(CC) -o $@T.o $(ASFLAGS) -c -x assembler - Thanks, Florian -- Red Hat GmbH, https://de.redhat.com/ , Registered seat: Grasbrunn, Commercial register: Amtsgericht Muenchen, HRB 153243, Managing Directors: Charles Cachera, Brian Klemm, Laurie Krebs, Michael O'Neill