提交 c18d05f0 编写于 作者: F Felix Fietkau 提交者: Rich Felker

ldso: fix GDB dynamic linker info on MIPS

GDB is looking for a pointer to the ldso debug info in the data of the
..rld_map section.
Signed-off-by: NFelix Fietkau <nbd@openwrt.org>
上级 831e9d9e
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
#define REL_TPOFF R_MIPS_TLS_TPREL32 #define REL_TPOFF R_MIPS_TLS_TPREL32
#define NEED_MIPS_GOT_RELOCS 1 #define NEED_MIPS_GOT_RELOCS 1
#define DYNAMIC_IS_RO 1 #define DT_DEBUG_INDIRECT DT_MIPS_RLD_MAP
#define ARCH_SYM_REJECT_UND(s) (!((s)->st_other & STO_MIPS_PLT)) #define ARCH_SYM_REJECT_UND(s) (!((s)->st_other & STO_MIPS_PLT))
#define CRTJMP(pc,sp) __asm__ __volatile__( \ #define CRTJMP(pc,sp) __asm__ __volatile__( \
......
...@@ -1582,11 +1582,14 @@ _Noreturn void __dls3(size_t *sp) ...@@ -1582,11 +1582,14 @@ _Noreturn void __dls3(size_t *sp)
load_deps(&app); load_deps(&app);
make_global(&app); make_global(&app);
#ifndef DYNAMIC_IS_RO for (i=0; app.dynv[i]; i+=2) {
for (i=0; app.dynv[i]; i+=2) if (!DT_DEBUG_INDIRECT && app.dynv[i]==DT_DEBUG)
if (app.dynv[i]==DT_DEBUG)
app.dynv[i+1] = (size_t)&debug; app.dynv[i+1] = (size_t)&debug;
#endif if (DT_DEBUG_INDIRECT && app.dynv[i]==DT_DEBUG_INDIRECT) {
size_t *ptr = (size_t *) app.dynv[i+1];
*ptr = (size_t)&debug;
}
}
/* The main program must be relocated LAST since it may contin /* The main program must be relocated LAST since it may contin
* copy relocations which depend on libraries' relocations. */ * copy relocations which depend on libraries' relocations. */
......
...@@ -83,6 +83,10 @@ struct fdpic_dummy_loadmap { ...@@ -83,6 +83,10 @@ struct fdpic_dummy_loadmap {
#define NEED_MIPS_GOT_RELOCS 0 #define NEED_MIPS_GOT_RELOCS 0
#endif #endif
#ifndef DT_DEBUG_INDIRECT
#define DT_DEBUG_INDIRECT 0
#endif
#define AUX_CNT 32 #define AUX_CNT 32
#define DYN_CNT 32 #define DYN_CNT 32
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册