Skip to contentSkip to conversation

Trivial patch for module.c: Strtab by sh_link field.

PATCH New Rusty Russell 1 participant 1 message Dec 27, 2002

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Trivial patch for module.c: Strtab by sh_link field.

[ This is Richard being nitpicky, but it's worth keeping him happy 8) ]

Name: Strtab by sh_link field.
From: Richard Henderson <[email protected]>
Status: Trivial

D: The strtab section is supposed to be found using the symtab's
D: sh_link field, not by name.

===== kernel/module.c 1.32 vs edited =====

kernel/module.c +3 -5
@@ -1010,6 +979,9 @@
 			/* Internal symbols */
 			DEBUGP("Symbol table in section %u\n", i);
 			symindex = i;
+			/* Strings */
+			strindex = sechdrs[i].sh_link;
+			DEBUGP("String table found in section %u\n", strindex);
 		} else if (strcmp(secstrings+sechdrs[i].sh_name,
 				  ".gnu.linkonce.modname") == 0) {
 			/* This module's name */
@@ -1024,11 +1000,6 @@
 			/* Exported symbols. */
 			DEBUGP("EXPORT table in section %u\n", i);
 			exportindex = i;
-		} else if (strcmp(secstrings + sechdrs[i].sh_name, ".strtab")
-			   == 0) {
-			/* Strings */
-			DEBUGP("String table found in section %u\n", i);
-			strindex = i;
 		} else if (strcmp(secstrings+sechdrs[i].sh_name, "__param")
 			   == 0) {
 			/* Setup parameter info */

--
Anyone who quotes me in their sig is an idiot. -- Rusty Russell.