This is the mail archive of the elfutils-devel@sourceware.org mailing list for the elfutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Treat ELFOSABI_NONE as ELFOSABI_LINUX in some places


I noticed that eu-readelf sometimes prints LOOS+0, e.g. for this file on 
Fedora 18 x86_64:

d8676a3561c9fe681a1ba80c305fa003  /usr/lib64/libboost_timer.so

Not sure if this a toolchain bug or elfutils bug.  readelf from binutils 
prints GNU_UNIQUE.

-- 
Florian Weimer / Red Hat Product Security Team
>From 3701aaed5235158c7f3077805233d414ea697710 Mon Sep 17 00:00:00 2001
From: Florian Weimer <fweimer@redhat.com>
Date: Wed, 16 Jan 2013 17:02:47 +0100
Subject: [PATCH] ebl_symbol_type_name, ebl_symbol_binding_name: check for
 ELFOSABI_NONE

Some DSOs use GNU_UNIQUE without declaring GNU extensions.
---
 libebl/eblsymbolbindingname.c | 3 ++-
 libebl/eblsymboltypename.c    | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/libebl/eblsymbolbindingname.c b/libebl/eblsymbolbindingname.c
index fd5bfda..930e9a3 100644
--- a/libebl/eblsymbolbindingname.c
+++ b/libebl/eblsymbolbindingname.c
@@ -63,7 +63,8 @@ ebl_symbol_binding_name (ebl, binding, buf, len)
 	    snprintf (buf, len, "LOPROC+%d", binding - STB_LOPROC);
 	  else if (binding == STB_GNU_UNIQUE
 		   && (ident = elf_getident (ebl->elf, NULL)) != NULL
-		   && ident[EI_OSABI] == ELFOSABI_LINUX)
+		   && (ident[EI_OSABI] == ELFOSABI_LINUX
+		       || ident[EI_OSABI] == ELFOSABI_NONE))
 	    return "GNU_UNIQUE";
 	  else if (binding >= STB_LOOS && binding <= STB_HIOS)
 	    snprintf (buf, len, "LOOS+%d", binding - STB_LOOS);
diff --git a/libebl/eblsymboltypename.c b/libebl/eblsymboltypename.c
index 4e653d2..591bea3 100644
--- a/libebl/eblsymboltypename.c
+++ b/libebl/eblsymboltypename.c
@@ -69,7 +69,8 @@ ebl_symbol_type_name (ebl, symbol, buf, len)
 	    snprintf (buf, len, "LOPROC+%d", symbol - STT_LOPROC);
 	  else if (symbol == STT_GNU_IFUNC
 		   && (ident = elf_getident (ebl->elf, NULL)) != NULL
-		   && ident[EI_OSABI] == ELFOSABI_LINUX)
+		   && (ident[EI_OSABI] == ELFOSABI_LINUX
+		       || ident[EI_OSABI] == ELFOSABI_NONE))
 	    return "GNU_IFUNC";
 	  else if (symbol >= STT_LOOS && symbol <= STT_HIOS)
 	    snprintf (buf, len, "LOOS+%d", symbol - STT_LOOS);
-- 
1.8.0.2


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]