Re: problem with modutils under mips

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 4 Apr 2003 14:26:34 -0800 (PST), 
Alvaro Martinez Echevarria <alvarom@cisco.com> wrote:
>We are having some modutils trouble under mips, when
>compiling modules with gcc-3.2 and debugging information. It
>turns out gcc is generating debug sections in DWARF format, i.e.,
>with elf section type SHT_MIPS_DWARF. That results in an error in
>obj/obj_mips.c:arch_load_proc_section(), as follows:
>
>foo.o: Unhandled section header type: 7000001e
>foo.o: Unknown section header type: 7000001e
>
>This is the simple fix I have:
>
>---------------------------------------------------------------------------=
>----
>--- obj_mips.c.OLD  2002-02-28 16:39:06.000000000 -0800
>+++ obj_mips.c    2003-04-02 18:34:44.000000000 -0800
>@@ -74,6 +74,7 @@
>     {
>     case SHT_MIPS_DEBUG:
>     case SHT_MIPS_REGINFO:
>+    case SHT_MIPS_DWARF:
>       /* Actually these two sections are as useless as something can be ..=
>=2E  */
>       sec->contents =3D NULL;
>       break;
>@@ -83,7 +84,6 @@
>     case SHT_MIPS_GPTAB:
>     case SHT_MIPS_UCODE:
>     case SHT_MIPS_OPTIONS:
>-    case SHT_MIPS_DWARF:
>     case SHT_MIPS_EVENTS:
>       /* These shouldn't ever be in a module file.  */
>       error("Unhandled section header type: %08x", sec->header.sh_type);
>---------------------------------------------------------------------------=
>
>At the same time, maybe there should be something after the
>"Unhandled" message for all those types, so the execution doesn't
>skip over to the default: case and return -1, but I don't know
>that much.

Thanks, this is what went into my tree, patch is against modutils 2.4.25.

Index: 26.1/obj/obj_mips.c
--- 26.1/obj/obj_mips.c Fri, 01 Mar 2002 11:39:06 +1100 kaos (modutils-2.4/c/10_obj_mips.c 1.4 644)
+++ 26.1(w)/obj/obj_mips.c Sat, 05 Apr 2003 08:36:33 +1000 kaos (modutils-2.4/c/10_obj_mips.c 1.4 644)
@@ -74,7 +74,8 @@ arch_load_proc_section(struct obj_sectio
     {
     case SHT_MIPS_DEBUG:
     case SHT_MIPS_REGINFO:
-      /* Actually these two sections are as useless as something can be ...  */
+    case SHT_MIPS_DWARF:
+      /* Ignore debugging sections  */
       sec->contents = NULL;
       break;
 
@@ -83,10 +84,10 @@ arch_load_proc_section(struct obj_sectio
     case SHT_MIPS_GPTAB:
     case SHT_MIPS_UCODE:
     case SHT_MIPS_OPTIONS:
-    case SHT_MIPS_DWARF:
     case SHT_MIPS_EVENTS:
       /* These shouldn't ever be in a module file.  */
       error("Unhandled section header type: %08x", sec->header.sh_type);
+      return -1;
 
     default:
       /* We don't even know the type.  This time it might as well be a




[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux