summaryrefslogtreecommitdiffstats
path: root/tests/alldts.c
diff options
context:
space:
mode:
authorDi Chen <[email protected]>2022-03-01 20:44:38 +0800
committerMark Wielaard <[email protected]>2022-04-19 10:13:11 +0200
commit5b497d8da4920bf7b63a4aa3752cf580b3ad654c (patch)
tree974a3f31a9a70946bf9bb4aea89af4ad2b7aa210 /tests/alldts.c
parent21f089d190ad5f5ebbbbea1a3e1db1acfec1dbe9 (diff)
readelf: Don't consider padding DT_NULL as dynamic section entry
when using `$ eu-readelf -d {FILE}` to get the number of dynamic section entris, it wrongly counts the padding DT_NULLs as dynamic section entries. However, DT_NULL Marks end of dynamic section. They should not be considered as dynamic section entries. https://sourceware.org/bugzilla/show_bug.cgi?id=28928 Signed-off-by: Di Chen <[email protected]>
Diffstat (limited to 'tests/alldts.c')
-rw-r--r--tests/alldts.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/alldts.c b/tests/alldts.c
index 3e9f9fe6..d0fe4f24 100644
--- a/tests/alldts.c
+++ b/tests/alldts.c
@@ -44,7 +44,7 @@ main (void)
Dwelf_Strent *shstrtabse;
const Elf32_Sword dtflags[] =
{
- DT_NULL, DT_NEEDED, DT_PLTRELSZ, DT_PLTGOT,
+ DT_NEEDED, DT_PLTRELSZ, DT_PLTGOT,
DT_HASH, DT_STRTAB, DT_SYMTAB, DT_RELA,
DT_RELASZ, DT_RELAENT, DT_STRSZ, DT_SYMENT,
DT_INIT, DT_FINI, DT_SONAME, DT_RPATH,
@@ -61,7 +61,8 @@ main (void)
DT_GNU_LIBLIST, DT_CONFIG, DT_DEPAUDIT, DT_AUDIT,
DT_PLTPAD, DT_MOVETAB, DT_SYMINFO, DT_RELACOUNT,
DT_RELCOUNT, DT_FLAGS_1, DT_VERDEF, DT_VERDEFNUM,
- DT_VERNEED, DT_VERNEEDNUM, DT_AUXILIARY, DT_FILTER
+ DT_VERNEED, DT_VERNEEDNUM, DT_AUXILIARY, DT_FILTER,
+ DT_NULL
};
const int ndtflags = sizeof (dtflags) / sizeof (dtflags[0]);