LibC+LibELF: Add definitions for extra dtags

These are found in some libraries, and LibELF doesn't know how to handle
them, not even their name. Adding these definitions should at least help
readelf display information correctly, but more work is needed to
actually implement them.
This commit is contained in:
Rodrigo Tobar 2021-09-21 00:51:26 +08:00 committed by Andreas Kling
parent 3efd7b458a
commit a67e06184b
Notes: sideshowbarker 2024-07-18 03:26:31 +09:00
2 changed files with 15 additions and 0 deletions

View file

@ -552,9 +552,14 @@ typedef struct {
/* some other useful tags */
#define DT_GNU_HASH 0x6ffffef5 /* address of GNU hash table */
#define DT_VERSYM 0x6ffffff0 /* address of table provided by .gnu.version */
#define DT_RELACOUNT 0x6ffffff9 /* if present, number of RELATIVE */
#define DT_RELCOUNT 0x6ffffffa /* relocs, which must come first */
#define DT_FLAGS_1 0x6ffffffb
#define DT_VERDEF 0x6ffffffc /* address of version definition table */
#define DT_VERDEFNUM 0x6ffffffd /* number of version definitions */
#define DT_VERNEEDED 0x6ffffffe /* address of the dependency table */
#define DT_VERNEEDEDNUM 0x6fffffff /* number of entries in VERNEEDED */
/* Dynamic Flags - DT_FLAGS .dynamic entry */
#define DF_ORIGIN 0x00000001

View file

@ -422,6 +422,16 @@ const char* DynamicObject::name_for_dtag(ElfW(Sword) d_tag)
return "RELCOUNT"; /* relocs, which must come first */
case DT_FLAGS_1:
return "FLAGS_1";
case DT_VERDEF:
return "VERDEF";
case DT_VERDEFNUM:
return "VERDEFNUM";
case DT_VERSYM:
return "VERSYM";
case DT_VERNEEDED:
return "VERNEEDED";
case DT_VERNEEDEDNUM:
return "VERNEEDEDNUM";
default:
return "??";
}