elf: Fix direction of NODELETE log messages during symbol lookup

Message ID 87pmik59ig.fsf@oldenburg.str.redhat.com
State Committed
Commit a9f9ee2381944cee8b4b50c5c8321e3529c77e49
Headers
Series elf: Fix direction of NODELETE log messages during symbol lookup |

Checks

Context Check Description
dj/TryBot-apply_patch success Patch applied to master at the time it was sent
dj/TryBot-32bit success Build for i686

Commit Message

Florian Weimer July 5, 2022, 7 a.m. UTC
  NODELETE status is propagated from the referencing object to the
referenced object, not the other way round.  The code is correct, only
the log message has the wrong direction.

Tested on i686-linux-gnu and x86_64-linux-gnu.

---
 elf/dl-lookup.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

Adhemerval Zanella July 5, 2022, 12:39 p.m. UTC | #1
> On 5 Jul 2022, at 04:00, Florian Weimer via Libc-alpha <libc-alpha@sourceware.org> wrote:
> 
> NODELETE status is propagated from the referencing object to the
> referenced object, not the other way round.  The code is correct, only
> the log message has the wrong direction.
> 
> Tested on i686-linux-gnu and x86_64-linux-gnu.

LGTM, thanks.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>

> 
> ---
> elf/dl-lookup.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/elf/dl-lookup.c b/elf/dl-lookup.c
> index 8cb32321da..4c86dc694e 100644
> --- a/elf/dl-lookup.c
> +++ b/elf/dl-lookup.c
> @@ -646,11 +646,11 @@ add_dependency (struct link_map *undef_map, struct link_map *map, int flags)
> 	    {
> 	      if (undef_map->l_name[0] == '\0')
> 		_dl_debug_printf ("\
> -marking %s [%lu] as NODELETE due to reference to main program\n",
> +marking %s [%lu] as NODELETE due to reference from main program\n",
> 				  map->l_name, map->l_ns);
> 	      else
> 		_dl_debug_printf ("\
> -marking %s [%lu] as NODELETE due to reference to %s [%lu]\n",
> +marking %s [%lu] as NODELETE due to reference from %s [%lu]\n",
> 				  map->l_name, map->l_ns,
> 				  undef_map->l_name, undef_map->l_ns);
> 	    }
>
  

Patch

diff --git a/elf/dl-lookup.c b/elf/dl-lookup.c
index 8cb32321da..4c86dc694e 100644
--- a/elf/dl-lookup.c
+++ b/elf/dl-lookup.c
@@ -646,11 +646,11 @@  add_dependency (struct link_map *undef_map, struct link_map *map, int flags)
 	    {
 	      if (undef_map->l_name[0] == '\0')
 		_dl_debug_printf ("\
-marking %s [%lu] as NODELETE due to reference to main program\n",
+marking %s [%lu] as NODELETE due to reference from main program\n",
 				  map->l_name, map->l_ns);
 	      else
 		_dl_debug_printf ("\
-marking %s [%lu] as NODELETE due to reference to %s [%lu]\n",
+marking %s [%lu] as NODELETE due to reference from %s [%lu]\n",
 				  map->l_name, map->l_ns,
 				  undef_map->l_name, undef_map->l_ns);
 	    }