Revert "readelf: Do not require EI_OSABI for IFUNC."
authorMartin Liska <mliska@suse.cz>
Fri, 25 Nov 2022 13:00:26 +0000 (14:00 +0100)
committerMartin Liska <mliska@suse.cz>
Fri, 25 Nov 2022 13:00:26 +0000 (14:00 +0100)
This reverts commit ffbbab0b3a1000f862b6d4ce3d9a76ed14f08801.

binutils/readelf.c

index 365c1ede0a11b9d2d5c6800086c3c7c0991553a8..1bd6df9448a12f0705b1547da7a378f732da1ed8 100644 (file)
@@ -12724,9 +12724,6 @@ get_symbol_type (Filedata * filedata, unsigned int type)
     case STT_TLS:      return "TLS";
     case STT_RELC:      return "RELC";
     case STT_SRELC:     return "SRELC";
-    case STT_GNU_IFUNC: return "IFUNC"; /* As mentioned in PR29718, do not
-                                          require EI_OSABI as IFUNC is
-                                          a reseved name.  */
     default:
       if (type >= STT_LOPROC && type <= STT_HIPROC)
        {
@@ -12751,6 +12748,11 @@ get_symbol_type (Filedata * filedata, unsigned int type)
                return "HP_STUB";
            }
 
+         if (type == STT_GNU_IFUNC
+             && (filedata->file_header.e_ident[EI_OSABI] == ELFOSABI_GNU
+                 || filedata->file_header.e_ident[EI_OSABI] == ELFOSABI_FREEBSD))
+           return "IFUNC";
+
          snprintf (buff, sizeof (buff), _("<OS specific>: %d"), type);
        }
       else