summaryrefslogtreecommitdiff
path: root/libebl
diff options
context:
space:
mode:
authorRoland McGrath <roland@redhat.com>2010-01-04 21:59:07 -0800
committerRoland McGrath <roland@redhat.com>2010-01-04 21:59:07 -0800
commit0ccbbcd1244336d38f51648620b32b193d591cbb (patch)
treebccb82dbe2a1c9a403b15f5f6e17c77c04068d33 /libebl
parent2e79deb2cb049f3b0f3f45680dfe956cf99b25d8 (diff)
downloadelfutils-0ccbbcd1244336d38f51648620b32b193d591cbb.tar.gz
Make readelf -n check note name strings, handle "VMCOREINFO" flavor.
Diffstat (limited to 'libebl')
-rw-r--r--libebl/ChangeLog8
-rw-r--r--libebl/ebl-hooks.h6
-rw-r--r--libebl/eblcorenote.c14
-rw-r--r--libebl/eblopenbackend.c8
-rw-r--r--libebl/libebl.h10
5 files changed, 27 insertions, 19 deletions
diff --git a/libebl/ChangeLog b/libebl/ChangeLog
index c4411e70..aaa1c86d 100644
--- a/libebl/ChangeLog
+++ b/libebl/ChangeLog
@@ -1,3 +1,11 @@
+2010-01-04 Roland McGrath <roland@redhat.com>
+
+ * eblcorenote.c (ebl_core_note): Take GElf_Nhdr * and name data
+ pointer instead of only n_type and n_descsz.
+ * libebl.h: Update declaration.
+ * ebl-hooks.h: Update core_note hook signature.
+ * eblopenbackend.c (default_core_note): Likewise.
+
2009-10-14 Roland McGrath <roland@redhat.com>
* eblobjnote.c (ebl_object_note): Clean up NT_GNU_GOLD_VERSION printing.
diff --git a/libebl/ebl-hooks.h b/libebl/ebl-hooks.h
index d483f2a3..59e73c54 100644
--- a/libebl/ebl-hooks.h
+++ b/libebl/ebl-hooks.h
@@ -1,5 +1,5 @@
/* Backend hook signatures internal interface for libebl.
- Copyright (C) 2000-2009 Red Hat, Inc.
+ Copyright (C) 2000-2010 Red Hat, Inc.
This file is part of Red Hat elfutils.
Red Hat elfutils is free software; you can redistribute it and/or modify
@@ -114,8 +114,8 @@ const char *EBLHOOK(core_note_type_name) (uint32_t, char *, size_t);
const char *EBLHOOK(object_note_type_name) (uint32_t, char *, size_t);
/* Describe core note format. */
-int EBLHOOK(core_note) (GElf_Word, GElf_Word, GElf_Word *, size_t *,
- const Ebl_Register_Location **,
+int EBLHOOK(core_note) (const GElf_Nhdr *, const char *,
+ GElf_Word *, size_t *, const Ebl_Register_Location **,
size_t *, const Ebl_Core_Item **);
/* Handle object file note. */
diff --git a/libebl/eblcorenote.c b/libebl/eblcorenote.c
index 553d5ba9..7549ca61 100644
--- a/libebl/eblcorenote.c
+++ b/libebl/eblcorenote.c
@@ -1,5 +1,5 @@
/* Describe known core note formats.
- Copyright (C) 2007 Red Hat, Inc.
+ Copyright (C) 2007, 2010 Red Hat, Inc.
This file is part of Red Hat elfutils.
Red Hat elfutils is free software; you can redistribute it and/or modify
@@ -61,19 +61,19 @@
int
-ebl_core_note (ebl, n_type, descsz,
+ebl_core_note (ebl, nhdr, name,
regs_offset, nregloc, reglocs, nitems, items)
Ebl *ebl;
- GElf_Word n_type;
- GElf_Word descsz;
+ const GElf_Nhdr *nhdr;
+ const char *name;
GElf_Word *regs_offset;
size_t *nregloc;
const Ebl_Register_Location **reglocs;
size_t *nitems;
const Ebl_Core_Item **items;
{
- int result = ebl->core_note (n_type, descsz, regs_offset, nregloc, reglocs,
- nitems, items);
+ int result = ebl->core_note (nhdr, name,
+ regs_offset, nregloc, reglocs, nitems, items);
if (result == 0)
{
/* The machine specific function did not know this type. */
@@ -81,7 +81,7 @@ ebl_core_note (ebl, n_type, descsz,
*regs_offset = 0;
*nregloc = 0;
*reglocs = NULL;
- switch (n_type)
+ switch (nhdr->n_type)
{
#define ITEMS(type, table) \
case type: \
diff --git a/libebl/eblopenbackend.c b/libebl/eblopenbackend.c
index b1bad903..edd8c4a7 100644
--- a/libebl/eblopenbackend.c
+++ b/libebl/eblopenbackend.c
@@ -1,5 +1,5 @@
/* Generate ELF backend handle.
- Copyright (C) 2000-2009 Red Hat, Inc.
+ Copyright (C) 2000-2010 Red Hat, Inc.
This file is part of Red Hat elfutils.
Red Hat elfutils is free software; you can redistribute it and/or modify
@@ -186,7 +186,7 @@ static const char *default_core_note_type_name (uint32_t, char *buf,
size_t len);
static const char *default_object_note_type_name (uint32_t, char *buf,
size_t len);
-static int default_core_note (GElf_Word n_type, GElf_Word descsz,
+static int default_core_note (const GElf_Nhdr *nhdr, const char *name,
GElf_Word *regs_offset, size_t *nregloc,
const Ebl_Register_Location **reglocs,
size_t *nitems, const Ebl_Core_Item **);
@@ -604,8 +604,8 @@ default_auxv_info (GElf_Xword a_type __attribute__ ((unused)),
}
static int
-default_core_note (GElf_Word n_type __attribute__ ((unused)),
- GElf_Word descsz __attribute__ ((unused)),
+default_core_note (const GElf_Nhdr *nhdr __attribute__ ((unused)),
+ const char *name __attribute__ ((unused)),
GElf_Word *ro __attribute__ ((unused)),
size_t *nregloc __attribute__ ((unused)),
const Ebl_Register_Location **reglocs
diff --git a/libebl/libebl.h b/libebl/libebl.h
index 1a56b966..c94ad78f 100644
--- a/libebl/libebl.h
+++ b/libebl/libebl.h
@@ -1,5 +1,5 @@
/* Interface for libebl.
- Copyright (C) 2000, 2001-2009 Red Hat, Inc.
+ Copyright (C) 2000-2010 Red Hat, Inc.
This file is part of Red Hat elfutils.
Red Hat elfutils is free software; you can redistribute it and/or modify
@@ -379,13 +379,13 @@ typedef struct
bool thread_identifier;
} Ebl_Core_Item;
-/* Describe the format of a core file note with type field matching N_TYPE
- and descriptor size matching DESCSZ. */
-extern int ebl_core_note (Ebl *ebl, GElf_Word n_type, GElf_Word descsz,
+/* Describe the format of a core file note with the given header and NAME.
+ NAME is not guaranteed terminated, it's NHDR->n_namesz raw bytes. */
+extern int ebl_core_note (Ebl *ebl, const GElf_Nhdr *nhdr, const char *name,
GElf_Word *regs_offset, size_t *nregloc,
const Ebl_Register_Location **reglocs,
size_t *nitems, const Ebl_Core_Item **items)
- __nonnull_attribute__ (1, 4, 5, 6, 7, 8);
+ __nonnull_attribute__ (1, 2, 3, 4, 5, 6, 7, 8);
/* Describe the auxv type number. */
extern int ebl_auxv_info (Ebl *ebl, GElf_Xword a_type,