[v1.2] Remove duplicate code in elf/dl-deps.c
diff mbox

Message ID 20140523130101.GA10153@domone.podge
State New
Headers show

Commit Message

Ondřej Bílka May 23, 2014, 1:01 p.m. UTC
On Fri, May 23, 2014 at 11:42:01AM +0200, Ondřej Bílka wrote:
> On Mon, May 19, 2014 at 12:47:14PM +0200, Andreas Schwab wrote:
> > Ondřej Bílka <neleai@seznam.cz> writes:
> > 
> > > -		    /* For filter objects the dependency must be available.  */
> > 
> > Please keep the comment.
> > 
> Fixed, ok now?
> 
This one, somewhat I send variant that does not set err variable.


         * elf/dl-deps.c (_dl_map_object_deps): Remove duplicate code.

Comments

Andreas Schwab May 26, 2014, 8:27 a.m. UTC | #1
Ok.

Andreas.

Patch
diff mbox

diff --git a/elf/dl-deps.c b/elf/dl-deps.c
index 9c83c81..c3b0cfc 100644
--- a/elf/dl-deps.c
+++ b/elf/dl-deps.c
@@ -302,22 +302,24 @@  _dl_map_object_deps (struct link_map *map,
 		/* Store the tag in the argument structure.  */
 		args.name = name;
 
-		if (d->d_tag == DT_AUXILIARY)
+		/* Say that we are about to load an auxiliary library.  */
+		if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_LIBS,
+				      0))
+		  _dl_debug_printf ("load auxiliary object=%s"
+				    " requested by file=%s\n",
+				    name,
+				    DSO_FILENAME (l->l_name));
+
+		/* We must be prepared that the addressed shared
+		   object is not available.  For filter objects the dependency
+		   must be available.  */
+		bool malloced;
+		int err = _dl_catch_error (&objname, &errstring, &malloced,
+					openaux, &args);
+
+		if (__glibc_unlikely (errstring != NULL))
 		  {
-		    /* Say that we are about to load an auxiliary library.  */
-		    if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_LIBS,
-					  0))
-		      _dl_debug_printf ("load auxiliary object=%s"
-					" requested by file=%s\n",
-					name,
-					DSO_FILENAME (l->l_name));
-
-		    /* We must be prepared that the addressed shared
-		       object is not available.  */
-		    bool malloced;
-		    (void) _dl_catch_error (&objname, &errstring, &malloced,
-					    openaux, &args);
-		    if (__glibc_unlikely (errstring != NULL))
+		    if (d->d_tag == DT_AUXILIARY)
 		      {
 			/* We are not interested in the error message.  */
 			assert (errstring != NULL);
@@ -327,23 +329,9 @@  _dl_map_object_deps (struct link_map *map,
 			/* Simply ignore this error and continue the work.  */
 			continue;
 		      }
-		  }
-		else
-		  {
-		    /* Say that we are about to load an auxiliary library.  */
-		    if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_LIBS,
-					  0))
-		      _dl_debug_printf ("load filtered object=%s"
-					" requested by file=%s\n",
-					name,
-					DSO_FILENAME (l->l_name));
-
-		    /* For filter objects the dependency must be available.  */
-		    bool malloced;
-		    int err = _dl_catch_error (&objname, &errstring, &malloced,
-					       openaux, &args);
-		    if (__glibc_unlikely (errstring != NULL))
+		    else
 		      {
+
 			char *new_errstring = strdupa (errstring);
 			objname = strdupa (objname);
 			if (malloced)