Make enum plt_status enumerators uppercase
diff --git a/backend.h b/backend.h
index 314ad93..5cd6c72 100644
--- a/backend.h
+++ b/backend.h
@@ -289,9 +289,9 @@
size_t sym_index, GElf_Rela *rela, GElf_Sym *sym);
enum plt_status {
- plt_fail,
- plt_ok,
- plt_default,
+ PLT_FAIL,
+ PLT_OK,
+ PLT_DEFAULT,
};
/* The following callback has to be implemented in backend if arch.h
@@ -302,9 +302,9 @@
* The corresponding PLT entry is for symbol called NAME, and it's
* I-th relocation in the file.
*
- * If this function returns plt_default, PLT address is obtained by
- * calling arch_plt_sym_val, and symbol is allocated. If plt_ok or
- * plt_default are returned, the chain of symbols passed back in RET
+ * If this function returns PLT_DEFAULT, PLT address is obtained by
+ * calling arch_plt_sym_val, and symbol is allocated. If PLT_OK or
+ * PLT_DEFAULT are returned, the chain of symbols passed back in RET
* is added to library under construction. */
enum plt_status arch_elf_add_plt_entry(struct process *proc, struct ltelf *lte,
const char *name, GElf_Rela *rela,
diff --git a/ltrace-elf.c b/ltrace-elf.c
index c147ad8..1d0f769 100644
--- a/ltrace-elf.c
+++ b/ltrace-elf.c
@@ -106,7 +106,7 @@
const char *a_name, GElf_Rela *rela, size_t ndx,
struct library_symbol **ret)
{
- return plt_default;
+ return PLT_DEFAULT;
}
#endif
@@ -566,14 +566,14 @@
struct library_symbol *libsym = NULL;
switch (arch_elf_add_plt_entry(proc, lte, name,
&rela, i, &libsym)) {
- case plt_default:
+ case PLT_DEFAULT:
if (default_elf_add_plt_entry(proc, lte, name,
&rela, i, &libsym) < 0)
/* fall-through */
- case plt_fail:
+ case PLT_FAIL:
return -1;
/* fall-through */
- case plt_ok:
+ case PLT_OK:
if (libsym != NULL) {
/* If we are adding those symbols just
* for tracing exports, mark them all
diff --git a/ltrace-elf.h b/ltrace-elf.h
index f0b7c90..b76d1eb 100644
--- a/ltrace-elf.h
+++ b/ltrace-elf.h
@@ -79,12 +79,12 @@
struct library *ltelf_read_main_binary(struct process *proc, const char *path);
/* Create a default PLT entry. This can be used instead (or in
- * addition to) returning plt_default from arch_elf_add_plt_entry.
+ * addition to) returning PLT_DEFAULT from arch_elf_add_plt_entry.
* RET shall be initialized, the created symbol will be added to the
* beginning of the linked list at *RET. This function doesn't add
* the symbol to LTE. arch_elf_add_plt_entry has the chance to adjust
- * symbol internals to its liking, and then return either plt_default
- * or plt_ok. */
+ * symbol internals to its liking, and then return either PLT_DEFAULT
+ * or PLT_OK. */
int default_elf_add_plt_entry(struct process *proc, struct ltelf *lte,
const char *a_name, GElf_Rela *rela, size_t ndx,
struct library_symbol **ret);
diff --git a/sysdeps/linux-gnu/mipsel/plt.c b/sysdeps/linux-gnu/mipsel/plt.c
index b10bbbd..ce33406 100644
--- a/sysdeps/linux-gnu/mipsel/plt.c
+++ b/sysdeps/linux-gnu/mipsel/plt.c
@@ -351,7 +351,7 @@
struct library_symbol *libsym = malloc(sizeof(*libsym));
if (libsym == NULL)
- return plt_fail;
+ return PLT_FAIL;
GElf_Addr addr = arch_plt_sym_val(lte, sym_index, 0);
@@ -390,12 +390,12 @@
}
*ret = libsym;
- return plt_ok;
+ return PLT_OK;
fail:
free(name);
free(libsym);
- return plt_fail;
+ return PLT_FAIL;
}
int
diff --git a/sysdeps/linux-gnu/ppc/plt.c b/sysdeps/linux-gnu/ppc/plt.c
index e49d30e..f5a87d6 100644
--- a/sysdeps/linux-gnu/ppc/plt.c
+++ b/sysdeps/linux-gnu/ppc/plt.c
@@ -600,12 +600,12 @@
{
if (lte->ehdr.e_machine == EM_PPC) {
if (lte->arch.secure_plt)
- return plt_default;
+ return PLT_DEFAULT;
struct library_symbol *libsym = NULL;
if (default_elf_add_plt_entry(proc, lte, a_name, rela, ndx,
&libsym) < 0)
- return plt_fail;
+ return PLT_FAIL;
/* On PPC32 with BSS PLT, delay the symbol until
* dynamic linker is done. */
@@ -613,7 +613,7 @@
libsym->delayed = 1;
*ret = libsym;
- return plt_ok;
+ return PLT_OK;
}
/* PPC64. If we have stubs, we return a chain of breakpoint
@@ -636,7 +636,7 @@
if (chain != NULL) {
*ret = chain;
- return plt_ok;
+ return PLT_OK;
}
/* We don't have stub symbols. Find corresponding .plt slot,
@@ -653,7 +653,7 @@
GElf_Addr plt_slot_value;
if (read_plt_slot_value(proc, plt_slot_addr, &plt_slot_value) < 0)
- return plt_fail;
+ return PLT_FAIL;
char *name = strdup(a_name);
struct library_symbol *libsym = malloc(sizeof(*libsym));
@@ -663,7 +663,7 @@
fail:
free(name);
free(libsym);
- return plt_fail;
+ return PLT_FAIL;
}
/* XXX The double cast should be removed when
@@ -696,7 +696,7 @@
}
*ret = libsym;
- return plt_ok;
+ return PLT_OK;
}
void