public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 01/10] backends: Make the reloc_nametable zero element an one char array.
@ 2020-06-16 22:25 Mark Wielaard
  2020-06-16 22:25 ` [PATCH 02/10] libdw: Add missing FALLTHROUGH in execute_cfi Mark Wielaard
                   ` (9 more replies)
  0 siblings, 10 replies; 17+ messages in thread
From: Mark Wielaard @ 2020-06-16 22:25 UTC (permalink / raw)
  To: elfutils-devel; +Cc: Mark Wielaard

We are using the reloc_nametable zero element as an char array.
So make that element an actual array (we are actually after one
of the next string arrays in the table).

Signed-off-by: Mark Wielaard <mark@klomp.org>
---
 backends/ChangeLog      | 6 ++++++
 backends/common-reloc.c | 6 +++---
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/backends/ChangeLog b/backends/ChangeLog
index 7d3578b0..c85dfd2a 100644
--- a/backends/ChangeLog
+++ b/backends/ChangeLog
@@ -1,3 +1,9 @@
+2020-06-16  Mark Wielard  <mark@klomp.org>
+
+	* common-reloc.c (reloc_nametable): Make zero a 1 char array.
+	Initialize it as an array { '\0' }.
+	(reloc_type_name): Access zero as an array.
+
 2020-06-10  Mark Wielard  <mark@klomp.org>
 
 	* aarch64_init.c (aarch64_init): Remove ehlen, return eh.
diff --git a/backends/common-reloc.c b/backends/common-reloc.c
index 096ed1c7..a91bc87d 100644
--- a/backends/common-reloc.c
+++ b/backends/common-reloc.c
@@ -45,14 +45,14 @@
 
 static const struct EBLHOOK(reloc_nametable)
 {
-  char zero;
+  char zero[1];
 #define	RELOC_TYPE(type, uses) \
   char name_##type[sizeof R_NAME (type)];
 #include RELOC_TYPES
 #undef RELOC_TYPE
 } EBLHOOK(reloc_nametable) =
   {
-    '\0',
+    { '\0' },
 #define	RELOC_TYPE(type, uses) R_NAME (type),
 #include RELOC_TYPES
 #undef RELOC_TYPE
@@ -92,7 +92,7 @@ EBLHOOK(reloc_type_name) (int reloc,
 #endif
 
   if (reloc >= 0 && reloc < nreloc && EBLHOOK(reloc_nameidx)[reloc] != 0)
-    return &reloc_namestr[EBLHOOK(reloc_nameidx)[reloc]];
+    return reloc_namestr[EBLHOOK(reloc_nameidx)[reloc]];
   return NULL;
 }
 
-- 
2.18.4


^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2020-06-24 15:04 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-16 22:25 [PATCH 01/10] backends: Make the reloc_nametable zero element an one char array Mark Wielaard
2020-06-16 22:25 ` [PATCH 02/10] libdw: Add missing FALLTHROUGH in execute_cfi Mark Wielaard
2020-06-19 12:56   ` Mark Wielaard
2020-06-16 22:25 ` [PATCH 03/10] elflint: Explicitly check and ignore elf_compress error Mark Wielaard
2020-06-19 13:48   ` Mark Wielaard
2020-06-16 22:25 ` [PATCH 04/10] libdwfl: When we find a compressed image, use that, don't search for others Mark Wielaard
2020-06-19 17:03   ` Mark Wielaard
2020-06-16 22:25 ` [PATCH 05/10] libdwfl: Flag an error if CIE return_address_register is invalid Mark Wielaard
2020-06-19 17:58   ` Mark Wielaard
2020-06-16 22:25 ` [PATCH 06/10] ar, ranlib: Call fchown before fchmod, explicitly check and ignore errors Mark Wielaard
2020-06-19 18:52   ` Mark Wielaard
2020-06-16 22:25 ` [PATCH 07/10] debuginfod: Handle not being able to fopen interval_path Mark Wielaard
2020-06-24 15:04   ` Mark Wielaard
2020-06-16 22:25 ` [PATCH 08/10] debuginfod: Make sure suffix can place zero terminator when copying filename Mark Wielaard
2020-06-16 22:25 ` [PATCH 09/10] debuginfod: Fix build_id hexadecimal length check Mark Wielaard
2020-06-16 22:25 ` [PATCH 10/10] debuginfod: Make sure handle_data can be allocated and is always freed Mark Wielaard
2020-06-19 11:43 ` [PATCH 01/10] backends: Make the reloc_nametable zero element an one char array Mark Wielaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).