[PATCH 01/16] elfops: Fix symbol type (weak, undef) definitions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
---
 elfops.c      |    4 ++++
 elfops_core.c |    2 +-
 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;
-- 
1.6.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-modules" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux