From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from zmcc-2-mx.zmailcloud.com (zmcc-2-mx.zmailcloud.com [52.37.197.7]) by sourceware.org (Postfix) with ESMTPS id 07B923857033 for ; Wed, 4 Nov 2020 14:50:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 07B923857033 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=symas.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=hyc@symas.com Received: from zmcc-2.zmailcloud.com (zmcc-2-mta-1.zmailcloud.com [146.148.52.56]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by zmcc-2-mx.zmailcloud.com (Postfix) with ESMTPS id 27C514056F; Wed, 4 Nov 2020 08:50:18 -0600 (CST) Received: from zmcc-2.zmailcloud.com (localhost [127.0.0.1]) by zmcc-2-mta-1.zmailcloud.com (Postfix) with ESMTPS id A30FBCFFE8; Wed, 4 Nov 2020 08:50:17 -0600 (CST) Received: from localhost (localhost [127.0.0.1]) by zmcc-2-mta-1.zmailcloud.com (Postfix) with ESMTP id 8AE30CFFE5; Wed, 4 Nov 2020 08:50:17 -0600 (CST) DKIM-Filter: OpenDKIM Filter v2.10.3 zmcc-2-mta-1.zmailcloud.com 8AE30CFFE5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=symas.com; s=37C7994C-28CA-11EA-A30F-68F90BB9D764; t=1604501417; bh=nZT7nEbcM8Pb9QxQ1NT67MD3T4SStzS3k5sESgXa+d0=; h=To:From:Message-ID:Date:MIME-Version; b=hB9L41BkuEFumqh2/6H+Vf105yhYEzqHztbbO5OWGD7mUFE8ZSIrEjyQM42YKbvdB +Hsl2Xcx0Xfm07WdZ3jM3ZwX1s1B7UhlzWz5T6h+wqrql5mGt+0dON/Lm3NPXueAYN 7Dhm9KFzBe0PPy5US7Qy8v56l2KuemC97bS1FkxydARa3o/QtWtpuM/yEu7HaayxK2 DVbV5YfIKSfzj8KpOmAkPgn+aRX1gkQR73GndChKTMd8VCFnGMWnMlP7bfRs9Bgsu7 rGdtUvgeDIJca1BWx1/qssuj31vg9wMJyZpa8o11yPV6wiTfJLR3FmUulz6gRsEUdc 6haMhdVVGEMbA== Received: from zmcc-2.zmailcloud.com ([127.0.0.1]) by localhost (zmcc-2-mta-1.zmailcloud.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id VInfkCulzUE9; Wed, 4 Nov 2020 08:50:17 -0600 (CST) Received: from [192.168.1.155] (unknown [84.203.30.144]) by zmcc-2-mta-1.zmailcloud.com (Postfix) with ESMTPSA id 64745CFFD0; Wed, 4 Nov 2020 08:50:16 -0600 (CST) Subject: Re: [PATCH] dependency list for static libraries To: Nick Clifton Cc: binutils@sourceware.org References: <53b8973b-40a4-2550-3307-66d7f13707d5@symas.com> <64fe82bd-9c00-b232-98d2-f46182fb16ba@symas.com> <9889c54b-4dd3-2275-6621-c2391cfd268d@redhat.com> <31f9062e-175d-06e9-695a-797c7ee11420@symas.com> <58620dc1-3bb9-aaae-b476-ebb613ecb627@redhat.com> <1aaf4429-074c-7912-e6e6-4d2f82d6ef10@redhat.com> <7b118db2-9502-c45e-9f47-6b6f6a5f9646@symas.com> <7dba4046-3d50-c7e6-915d-08bf590bf057@redhat.com> From: Howard Chu Message-ID: Date: Wed, 4 Nov 2020 14:50:13 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0 SeaMonkey/2.53.3 MIME-Version: 1.0 In-Reply-To: <7dba4046-3d50-c7e6-915d-08bf590bf057@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RAZOR2_CF_RANGE_51_100, RAZOR2_CHECK, SPF_HELO_NONE, SPF_PASS, TXREP, URIBL_RED autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Nov 2020 14:50:20 -0000 Nick Clifton wrote: > Hi Howard, > >> One big question >> I still have is how to get this plugin to be used by default? > > I do not think that there is a way to guarantee this. After all > plugins, by design, are intended to be optional. > > Obviously if a build system is involved - one that is adding the > --record-libdeps option when creating libraries - then it will be > able to add the necessary linker command line option to invoke > the plugin as well. I suppose that means I'll still be using shell scripts to wrap these then. Was hoping to be able to do away with them. On a slightly related note - are linker plugins supposed to be compatible between ld and gold? I get a SEGV using gold: Reading symbols from ./ld-new... (gdb) r Starting program: /media/hyc/software/binutils.o/gold/ld-new -plugin ../ld/.libs/libdep_plugin.so -o ssljunk ../ld/ssljunk.o -L/usr/local/lib -lssl -L/usr/lib/x86_64-linux-gnu -lpthread -lc -ldl [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". Program received signal SIGSEGV, Segmentation fault. gold::Workqueue::add_to_queue (this=0x0, queue=0x8, t=0x555555bb3200, front=false) at ../../binutils-gdb/gold/workqueue.cc:154 154 Hold_lock hl(this->lock_); (gdb) bt #0 gold::Workqueue::add_to_queue (this=0x0, queue=0x8, t=0x555555bb3200, front=false) at ../../binutils-gdb/gold/workqueue.cc:154 #1 0x00005555559b70ab in gold::Plugin_manager::add_input_file (this=0x555555b8c350, pathname=, is_lib=) at /usr/include/c++/9/bits/char_traits.h:300 #2 0x00007ffff74b2d93 in onclaim_file (claimed=, file=) at ../../binutils-gdb/ld/libdep_plugin.c:217 #3 onclaim_file (file=, claimed=) at ../../binutils-gdb/ld/libdep_plugin.c:145 #4 0x00005555559b6b69 in gold::Plugin::claim_file (this=, plugin_input_file=0x555555b8c3a8) at ../../binutils-gdb/gold/plugin.cc:390 #5 gold::Plugin_manager::claim_file (this=this@entry=0x555555b8c350, input_file=0x555555c2b9e0, offset=441644, filesize=7880, elf_object=, elf_object@entry=0x555555c399e0) at ../../binutils-gdb/gold/plugin.cc:766 #6 0x00005555558c216f in gold::Archive::get_elf_object_for_member (this=0x555555b83c80, off=441584, punconfigured=) at ../../binutils-gdb/gold/options.h:1646 #7 0x00005555558c2c3e in gold::Archive::include_member (this=0x555555b83c80, symtab=0x7fffffff4760, layout=0x7fffffff4a20, input_objects=0x7fffffff4520, off=441584, mapfile=, sym=0x555555c176f0, why=0x7fffffff4150 "") at ../../binutils-gdb/gold/archive.cc:1030 #8 0x00005555558c3485 in gold::Archive::add_symbols (this=0x555555b83c80, symtab=0x7fffffff4760, layout=0x7fffffff4a20, input_objects=0x7fffffff4520, mapfile=0x0) at /usr/include/c++/9/bits/basic_string.h:2300 #9 0x00005555558c3641 in gold::Add_archive_symbols::run (this=0x555555c357e0, workqueue=0x7fffffff4460) at ../../binutils-gdb/gold/archive.cc:1142 #10 0x0000555555a0ea58 in gold::Workqueue::find_and_run_task (this=0x7fffffff4460, thread_number=0) at ../../binutils-gdb/gold/token.h:290 #11 0x0000555555a0ecaa in gold::Workqueue::process (this=this@entry=0x7fffffff4460, thread_number=thread_number@entry=0) at ../../binutils-gdb/gold/workqueue.cc:495 #12 0x00005555556c6e85 in main (argc=, argv=) at ../../binutils-gdb/gold/main.cc:252 (gdb) frame 2 #2 0x00007ffff74b2d93 in onclaim_file (claimed=, file=) at ../../binutils-gdb/ld/libdep_plugin.c:217 217 rv = tv_add_input_library (vec[i]+2); (gdb) While using ld yields: violino:/media/hyc/software/binutils.o/ld> ./ld-new -plugin ../ld/.libs/libdep_plugin.so -o ssljunk ../ld/ssljunk.o -L/usr/local/lib -lssl -L/usr/lib/x86_64-linux-gnu -lpthread -lc -ldl processed deps for library /usr/local/lib/libssl.a: -lcrypto ./ld-new: warning: cannot find entry symbol _start; defaulting to 0000000000404000 ./ld-new: /usr/local/lib/libcrypto.a(init.o): in function `ossl_init_register_atexit_ossl_': init.c:(.text+0x1c0): undefined reference to `atexit' ./ld-new: /usr/local/lib/libcrypto.a(threads_pthread.o): in function `fork_once_func': threads_pthread.c:(.text+0x1a): undefined reference to `pthread_atfork' (Testing with __.LIBDEP in libssl.a containing just "-lcrypto") -- -- Howard Chu CTO, Symas Corp. http://www.symas.com Director, Highland Sun http://highlandsun.com/hyc/ Chief Architect, OpenLDAP http://www.openldap.org/project/