Skip to contentSkip to conversation

depmod: Ignore PowerPC64 ABIv2 .TOC. symbol

PATCH RESEND Applied Michael Ellerman 2 participants 2 messages Jun 10, 2016 – Jun 11, 2016

lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 depmod: Ignore PowerPC64 ABIv2 .TOC. symbol

From: Anton Blanchard <[email protected]>

The .TOC. symbol on the PowerPC64 ABIv2 identifies the GOT pointer, similar to how other architectures use _GLOBAL_OFFSET_TABLE_.

This is not a symbol that needs relocation, and should be ignored by depmod.

---
 tools/depmod.c | 2 ++
 1 file changed, 2 insertions(+)
tools/depmod.c +2 -0
index 6e9bb4d..a2e07c1 100644
@@ -2153,6 +2153,8 @@ static void depmod_add_fake_syms(struct depmod *depmod)
 	depmod_symbol_add(depmod, "__this_module", true, 0, NULL);
 	/* On S390, this is faked up too */
 	depmod_symbol_add(depmod, "_GLOBAL_OFFSET_TABLE_", true, 0, NULL);
+	/* On PowerPC64 ABIv2, .TOC. is more or less _GLOBAL_OFFSET_TABLE_ */
+	depmod_symbol_add(depmod, "TOC.", true, 0, NULL);
 }
 
 static int depmod_load_symvers(struct depmod *depmod, const char *filename)
#1 lore raw
Quoted 17 lines · Michael Ellerman

From: Anton Blanchard <[email protected]>

The .TOC. symbol on the PowerPC64 ABIv2 identifies the GOT pointer, similar to how other architectures use _GLOBAL_OFFSET_TABLE_.

This is not a symbol that needs relocation, and should be ignored by depmod.

---
 tools/depmod.c | 2 ++
 1 file changed, 2 insertions(+)
tools/depmod.c +0 -0
index 6e9bb4d..a2e07c1 100644

tools/depmod.c static void depmod_add_fake_syms(struct depmod *depmod) · line 2160

Quoted 8 lines
tools/depmod.c +2 -0
@@ -2153,6 +2153,8 @@ static void depmod_add_fake_syms(struct depmod *depmod)
        depmod_symbol_add(depmod, "__this_module", true, 0, NULL);
        /* On S390, this is faked up too */
        depmod_symbol_add(depmod, "_GLOBAL_OFFSET_TABLE_", true, 0, NULL);
+       /* On PowerPC64 ABIv2, .TOC. is more or less _GLOBAL_OFFSET_TABLE_ */
+       depmod_symbol_add(depmod, "TOC.", true, 0, NULL);
 }
 
 static int depmod_load_symvers(struct depmod *depmod, const char *filename)

Applied, thanks

Lucas De Marchi