瀏覽代碼

[SPARC]: Handle UNWIND_INFO properly.

For sparc32 we need R_SPARC_UA32 relocation support, for
sparc64 we need the handle R_SPARC_DISP32 relocations.

Based upon reports and initial patch by Martin Habets.

Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller 19 年之前
父節點
當前提交
06a1be167e
共有 4 個文件被更改,包括 9 次插入2 次删除
  1. 1 0
      arch/sparc/kernel/module.c
  2. 2 1
      arch/sparc64/defconfig
  3. 5 0
      arch/sparc64/kernel/module.c
  4. 1 1
      lib/Kconfig.debug

+ 1 - 0
arch/sparc/kernel/module.c

@@ -113,6 +113,7 @@ int apply_relocate_add(Elf32_Shdr *sechdrs,
 
 
 		switch (ELF32_R_TYPE(rel[i].r_info)) {
 		switch (ELF32_R_TYPE(rel[i].r_info)) {
 		case R_SPARC_32:
 		case R_SPARC_32:
+		case R_SPARC_UA32:
 			location[0] = v >> 24;
 			location[0] = v >> 24;
 			location[1] = v >> 16;
 			location[1] = v >> 16;
 			location[2] = v >>  8;
 			location[2] = v >>  8;

+ 2 - 1
arch/sparc64/defconfig

@@ -1,7 +1,7 @@
 #
 #
 # Automatically generated make config: don't edit
 # Automatically generated make config: don't edit
 # Linux kernel version: 2.6.17-rc3
 # Linux kernel version: 2.6.17-rc3
-# Mon May  8 15:12:53 2006
+# Fri May 12 12:43:49 2006
 #
 #
 CONFIG_SPARC=y
 CONFIG_SPARC=y
 CONFIG_SPARC64=y
 CONFIG_SPARC64=y
@@ -1309,6 +1309,7 @@ CONFIG_DEBUG_BUGVERBOSE=y
 # CONFIG_DEBUG_INFO is not set
 # CONFIG_DEBUG_INFO is not set
 CONFIG_DEBUG_FS=y
 CONFIG_DEBUG_FS=y
 # CONFIG_DEBUG_VM is not set
 # CONFIG_DEBUG_VM is not set
+# CONFIG_UNWIND_INFO is not set
 CONFIG_FORCED_INLINING=y
 CONFIG_FORCED_INLINING=y
 # CONFIG_RCU_TORTURE_TEST is not set
 # CONFIG_RCU_TORTURE_TEST is not set
 # CONFIG_DEBUG_STACK_USAGE is not set
 # CONFIG_DEBUG_STACK_USAGE is not set

+ 5 - 0
arch/sparc64/kernel/module.c

@@ -143,6 +143,11 @@ int apply_relocate_add(Elf64_Shdr *sechdrs,
 			location[3] = v >>  0;
 			location[3] = v >>  0;
 			break;
 			break;
 
 
+		case R_SPARC_DISP32:
+			v -= (Elf64_Addr) location;
+			*loc32 = v;
+			break;
+
 		case R_SPARC_WDISP30:
 		case R_SPARC_WDISP30:
 			v -= (Elf64_Addr) location;
 			v -= (Elf64_Addr) location;
 			*loc32 = (*loc32 & ~0x3fffffff) |
 			*loc32 = (*loc32 & ~0x3fffffff) |

+ 1 - 1
lib/Kconfig.debug

@@ -189,7 +189,7 @@ config FRAME_POINTER
 config UNWIND_INFO
 config UNWIND_INFO
 	bool "Compile the kernel with frame unwind information"
 	bool "Compile the kernel with frame unwind information"
 	depends on !IA64
 	depends on !IA64
-	depends on !MODULES || !(MIPS || PARISC || PPC || SUPERH || SPARC64 || V850)
+	depends on !MODULES || !(MIPS || PARISC || PPC || SUPERH || V850)
 	help
 	help
 	  If you say Y here the resulting kernel image will be slightly larger
 	  If you say Y here the resulting kernel image will be slightly larger
 	  but not slower, and it will give very useful debugging information.
 	  but not slower, and it will give very useful debugging information.