From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/3339 Path: news.gmane.org!not-for-mail From: "Z. Gilboa" Newsgroups: gmane.linux.lib.musl.general Subject: patch: make the size of errbuf configurable Date: Sun, 19 May 2013 16:12:58 -0400 Message-ID: <5199324A.7020805@eservices.virginia.edu> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------090103080900070302010909" X-Trace: ger.gmane.org 1368994394 16035 80.91.229.3 (19 May 2013 20:13:14 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 19 May 2013 20:13:14 +0000 (UTC) To: Original-X-From: musl-return-3343-gllmg-musl=m.gmane.org@lists.openwall.com Sun May 19 22:13:14 2013 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1Ue9yj-0002UF-Ni for gllmg-musl@plane.gmane.org; Sun, 19 May 2013 22:13:13 +0200 Original-Received: (qmail 5242 invoked by uid 550); 19 May 2013 20:13:12 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 5230 invoked from network); 19 May 2013 20:13:12 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130510 Thunderbird/17.0.6 X-Originating-IP: [128.143.141.130] Xref: news.gmane.org gmane.linux.lib.musl.general:3339 Archived-At: --------------090103080900070302010909 Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit Greetings, When a shared library that resides in a deeply nested folder contains unresolved (long-named, mangled) symbols, the displayed name of the library and/or symbol might get truncated. The attached patch makes the size of errbuf (ldso/dynlink.c) configurable (--with-ld-errbuf-size), while yet leaving the default size of 128 unaffected. Best regards, Zvi --------------090103080900070302010909 Content-Type: text/x-patch; name="ld_errbuf_size.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="ld_errbuf_size.patch" >From 03e738888958d04b6c1bb900d571fb342916bc84 Mon Sep 17 00:00:00 2001 From: Z. Gilboa Date: Sun, 19 May 2013 15:33:09 -0400 Subject: [PATCH] ld: errbuf: make the buffer size configurable modified: configure modified: src/ldso/dynlink.c --- configure | 9 +++++++++ src/ldso/dynlink.c | 6 +++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/configure b/configure index 96f93b2..b063d37 100755 --- a/configure +++ b/configure @@ -30,6 +30,9 @@ Optional features: --disable-shared inhibit building shared library [enabled] --disable-static inhibit building static library [enabled] +Configurable settings: + --with-ld-errbuf-size set the size of the dynamic loader's error buffer [128] + Some influential environment variables: CC C compiler command [detected] CFLAGS C compiler flags [-Os -pipe ...] @@ -120,6 +123,7 @@ case "$arg" in --disable-warnings|--enable-warnings=no) warnings=no ;; --enable-gcc-wrapper|--enable-gcc-wrapper=yes) wrapper=yes ;; --disable-gcc-wrapper|--enable-gcc-wrapper=no) wrapper=no ;; +--with-ld-errbuf-size=*) ld_errbuf_size=${arg#*=} ;; --enable-*|--disable-*|--with-*|--without-*|--*dir=*|--build=*) ;; --host=*|--target=*) target=${arg#*=} ;; -* ) echo "$0: unknown option $arg" ;; @@ -310,7 +314,12 @@ test -z "$LIBCC" && try_libcc=`$CC -print-file-name=libpcc.a 2>/dev/null` \ && tryldflag LIBCC "$try_libcc" printf "using compiler runtime libraries: %s\n" "$LIBCC" +# configurable settings +if [ "$ld_errbuf_size"x != x ]; then + CFLAGS="$CFLAGS -DLD_ERRBUF_SIZE=$ld_errbuf_size" +fi +# generate config.mak printf "creating config.mak... " exec 3>&1 1>config.mak diff --git a/src/ldso/dynlink.c b/src/ldso/dynlink.c index dec9511..59106c5 100644 --- a/src/ldso/dynlink.c +++ b/src/ldso/dynlink.c @@ -21,8 +21,12 @@ #include "pthread_impl.h" #include "libc.h" +#ifndef LD_ERRBUF_SIZE +#define LD_ERRBUF_SIZE 128 +#endif + static int errflag; -static char errbuf[128]; +static char errbuf[LD_ERRBUF_SIZE]; #ifdef SHARED -- 1.7.9.5 --------------090103080900070302010909--