aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Robinson <andr345@gmail.com>2009-05-12 09:01:50 +0200
committerAndreas Robinson <andr345@gmail.com>2009-05-12 12:55:40 +0200
commit3cb0e5324fdf5356a4335f12e1a5afb2074976d6 (patch)
treefd3b49634f748123d7d0e1f34c3e6538250028e3
parent4ac9bc5b709b8a665e828e9543fdf65119beba7e (diff)
downloadmodule-init-tools-3cb0e5324fdf5356a4335f12e1a5afb2074976d6.tar.gz
elfops: Fix symbol type (weak, undef) definitions
Inline string literals might not have static lifetimes (C99 6.4.5). This corrects the assumption that they do, that was introduced in e35f9df6c1aa02a2f7aa0e319af4d0e70181a9ca Signed-off-by: Andreas Robinson <andr345@gmail.com>
-rw-r--r--elfops.c4
-rw-r--r--elfops_core.c2
2 files changed, 5 insertions, 1 deletions
diff --git a/elfops.c b/elfops.c
index 2d38051..9ae77ef 100644
--- a/elfops.c
+++ b/elfops.c
@@ -11,6 +11,10 @@
#include "elfops.h"
#include "tables.h"
+/* Symbol types, returned by load_dep_syms */
+static const char *weak_sym = "W";
+static const char *undef_sym = "U";
+
#define ELF32BIT
#include "elfops_core.c"
#undef ELF32BIT
diff --git a/elfops_core.c b/elfops_core.c
index 8e6f37e..8b7f4de 100644
--- a/elfops_core.c
+++ b/elfops_core.c
@@ -179,7 +179,7 @@ static struct string_table *PERBIT(load_dep_syms)(const char *pathname,
weak = (ELFPERBIT(ST_BIND)(END(syms[i].st_info, conv))
== STB_WEAK);
names = strtbl_add(name, names);
- *types = strtbl_add(weak ? "W" : "U", *types);
+ *types = strtbl_add(weak ? weak_sym : undef_sym, *types);
}
}
return names;