mipsel: Add mips specific symbol info loading
MIPS needs a backend specific way to load symbol info.
We add fields to the symbol representation to keep track
of the state of the dynamic symbol.
At arch_dynlink_done we go through the symbols that are
connected to a GOT entry but that where not resolved at
startup time (e.g function pointers to external syms).
Signed-off-by: Edgar E. Iglesias <edgar@axis.com>
diff --git a/proc.c b/proc.c
index 319ef31..99bf31b 100644
--- a/proc.c
+++ b/proc.c
@@ -637,6 +637,19 @@
assert(proc->leader == proc);
bp_addr = sym2addr(proc, libsym);
+
+ /* For external function pointers, MIPS brings in stub-less funcs
+ * that point to zero at startup. These symbols get resolved by
+ * the dynamic linker and are ready to use at arch_dynlink_done().
+ *
+ * Allow the backend to add these into the process representation
+ * but don't put breakpoints at this point. Let the backend fix that
+ * up later. */
+ if (bp_addr == 0 && libsym->plt_type == LS_TOPLT_GOTONLY) {
+ /* Don't add breakpoints yet. */
+ return CBS_CONT;
+ }
+
/* If there is an artificial breakpoint on the same address,
* its libsym will be NULL, and we can smuggle our libsym
* there. That artificial breakpoint is there presumably for