Properly publish read_relplt interface, rename it to elf_read_relocs
diff --git a/ltrace-elf.c b/ltrace-elf.c
index a468ee3..9100c46 100644
--- a/ltrace-elf.c
+++ b/ltrace-elf.c
@@ -505,8 +505,8 @@
}
int
-read_relplt(struct ltelf *lte, Elf_Scn *scn, GElf_Shdr *shdr,
- struct vect *rela_vec)
+elf_read_relocs(struct ltelf *lte, Elf_Scn *scn, GElf_Shdr *shdr,
+ struct vect *rela_vec)
{
if (vect_reserve_additional(rela_vec, lte->ehdr.e_shnum) < 0)
return -1;
@@ -661,8 +661,8 @@
}
if (shdr.sh_addr == relplt_addr
&& shdr.sh_size == relplt_size) {
- if (read_relplt(lte, scn, &shdr,
- <e->plt_relocs) < 0) {
+ if (elf_read_relocs(lte, scn, &shdr,
+ <e->plt_relocs) < 0) {
fprintf(stderr, "Couldn't get .rel*.plt"
" data from \"%s\": %s\n",
filename, elf_errmsg(-1));
diff --git a/ltrace-elf.h b/ltrace-elf.h
index 8e3da5a..57ed87d 100644
--- a/ltrace-elf.h
+++ b/ltrace-elf.h
@@ -117,6 +117,12 @@
void *data),
void *data);
+/* Read relocations from relocation section SCN with header SHDR and
+ * add them to RELA_VEC, which is a vector of GElf_Rela. Return 0 on
+ * success, or a negative value on failure. */
+int elf_read_relocs(struct ltelf *lte, Elf_Scn *scn, GElf_Shdr *shdr,
+ struct vect *rela_vec);
+
/* Read, respectively, 1, 2, 4, or 8 bytes from Elf data at given
* OFFSET, and store it in *RETP. Returns 0 on success or a negative
* value if there's not enough data. */
diff --git a/sysdeps/linux-gnu/ppc/plt.c b/sysdeps/linux-gnu/ppc/plt.c
index 45b7f7b..8b8b68c 100644
--- a/sysdeps/linux-gnu/ppc/plt.c
+++ b/sysdeps/linux-gnu/ppc/plt.c
@@ -587,8 +587,6 @@
* section, and as such are stored in .rela.dyn (where all
* non-PLT relocations are stored) instead of .rela.plt. Add
* these to lte->plt_relocs. */
- extern int read_relplt(struct ltelf *lte, Elf_Scn *scn, GElf_Shdr *shdr,
- struct vect *ret);
GElf_Addr rela, relasz;
Elf_Scn *rela_sec;
@@ -601,7 +599,7 @@
struct vect v;
VECT_INIT(&v, GElf_Rela);
- int ret = read_relplt(lte, rela_sec, &rela_shdr, &v);
+ int ret = elf_read_relocs(lte, rela_sec, &rela_shdr, &v);
if (ret >= 0
&& VECT_EACH(&v, GElf_Rela, NULL,
reloc_copy_if_irelative, lte) != NULL)