modutils-01.patch 4.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. diff -ur modutils-2.4.27/Makefile.in modutils-2.4.27-patched/Makefile.in
  2. --- modutils-2.4.27/Makefile.in 2004-03-07 01:24:48.000000000 -0600
  3. +++ modutils-2.4.27-patched/Makefile.in 2005-08-17 08:41:57.000000000 -0500
  4. @@ -3,7 +3,7 @@
  5. include Makefile.common
  6. TARGETS = all install-bin clean distclean realclean dep depend
  7. -SUBDIRS = util obj insmod genksyms depmod @kerneld_SUBDIR@
  8. +SUBDIRS = util obj insmod depmod @kerneld_SUBDIR@
  9. ifneq (@kerneld_SUBDIR@,)
  10. SUBDIRS += man_kerneld
  11. endif
  12. diff -ur modutils-2.4.27/depmod/depmod.c modutils-2.4.27-patched/depmod/depmod.c
  13. --- modutils-2.4.27/depmod/depmod.c 2003-03-22 20:34:28.000000000 -0600
  14. +++ modutils-2.4.27-patched/depmod/depmod.c 2005-08-17 21:33:40.000000000 -0500
  15. @@ -1132,8 +1132,11 @@
  16. return -1;
  17. for (ksym = ksyms; so_far < nksyms; ++so_far, ksym++) {
  18. - if (strncmp((char *)ksym->name, "GPLONLY_", 8) == 0)
  19. - ((char *)ksym->name) += 8;
  20. + if (strncmp((char *)ksym->name, "GPLONLY_", 8) == 0) {
  21. + char *p = (char *)ksym->name;
  22. + p += 8;
  23. + ksym->name = p;
  24. + }
  25. assert(n_syms < MAX_MAP_SYM);
  26. symtab[n_syms++] = addsym((char *)ksym->name, mod, SYM_DEFINED, 0);
  27. }
  28. diff -ur modutils-2.4.27/insmod/Makefile.in modutils-2.4.27-patched/insmod/Makefile.in
  29. --- modutils-2.4.27/insmod/Makefile.in 2003-10-26 22:42:07.000000000 -0600
  30. +++ modutils-2.4.27-patched/insmod/Makefile.in 2005-08-17 08:41:57.000000000 -0500
  31. @@ -126,10 +126,6 @@
  32. $(MKDIR) $(DESTDIR)$(sbindir); \
  33. $(INSTALL) $(STRIP) $$i $(DESTDIR)$(sbindir); done;
  34. set -e; \
  35. - for i in $(srcdir)/insmod_ksymoops_clean $(srcdir)/kernelversion; do \
  36. - $(MKDIR) $(DESTDIR)$(sbindir); \
  37. - $(INSTALL) $$i $(DESTDIR)$(sbindir); done;
  38. - set -e; \
  39. for i in $(COMB); do \
  40. ln -sf insmod $(DESTDIR)$(sbindir)/$$i; \
  41. (test "$(insmod_static)" = yes && \
  42. diff -ur modutils-2.4.27/insmod/insmod.c modutils-2.4.27-patched/insmod/insmod.c
  43. --- modutils-2.4.27/insmod/insmod.c 2003-10-26 20:34:46.000000000 -0600
  44. +++ modutils-2.4.27-patched/insmod/insmod.c 2005-08-17 21:34:04.000000000 -0500
  45. @@ -274,8 +274,11 @@
  46. */
  47. if (strncmp((char *)s->name, "GPLONLY_", 8) == 0) {
  48. gplonly_seen = 1;
  49. - if (gpl)
  50. - ((char *)s->name) += 8;
  51. + if (gpl) {
  52. + char *p = (char *)s->name;
  53. + p += 8;
  54. + s->name = p;
  55. + }
  56. else
  57. continue;
  58. }
  59. diff -ur modutils-2.4.27/obj/obj_kallsyms.c modutils-2.4.27-patched/obj/obj_kallsyms.c
  60. --- modutils-2.4.27/obj/obj_kallsyms.c 2002-02-28 18:39:06.000000000 -0600
  61. +++ modutils-2.4.27-patched/obj/obj_kallsyms.c 2005-08-17 21:29:36.000000000 -0500
  62. @@ -200,8 +200,8 @@
  63. /* Initial contents, header + one entry per input section. No strings. */
  64. osec->header.sh_size = sizeof(*a_hdr) + loaded*sizeof(*a_sec);
  65. - a_hdr = (struct kallsyms_header *) osec->contents =
  66. - xmalloc(osec->header.sh_size);
  67. + osec->contents = xmalloc(osec->header.sh_size);
  68. + a_hdr = (struct kallsyms_header *) osec->contents;
  69. memset(osec->contents, 0, osec->header.sh_size);
  70. a_hdr->size = sizeof(*a_hdr);
  71. a_hdr->sections = loaded;
  72. @@ -275,8 +275,8 @@
  73. a_hdr->symbol_off +
  74. a_hdr->symbols*a_hdr->symbol_size +
  75. strings_size - strings_left;
  76. - a_hdr = (struct kallsyms_header *) osec->contents =
  77. - xrealloc(a_hdr, a_hdr->total_size);
  78. + osec->contents = xrealloc(a_hdr, a_hdr->total_size);
  79. + a_hdr = (struct kallsyms_header *) osec->contents;
  80. p = (char *)a_hdr + a_hdr->symbol_off;
  81. memcpy(p, symbols, a_hdr->symbols*a_hdr->symbol_size);
  82. free(symbols);
  83. diff -ur modutils-2.4.27/obj/obj_mips.c modutils-2.4.27-patched/obj/obj_mips.c
  84. --- modutils-2.4.27/obj/obj_mips.c 2003-04-04 16:47:17.000000000 -0600
  85. +++ modutils-2.4.27-patched/obj/obj_mips.c 2005-08-17 21:29:20.000000000 -0500
  86. @@ -244,7 +244,8 @@
  87. archdata_sec->header.sh_size = 0;
  88. sec = obj_find_section(f, "__dbe_table");
  89. if (sec) {
  90. - ad = (struct archdata *) (archdata_sec->contents) = xmalloc(sizeof(*ad));
  91. + archdata_sec->contents = xmalloc(sizeof(*ad));
  92. + ad = (struct archdata *) archdata_sec->contents;
  93. memset(ad, 0, sizeof(*ad));
  94. archdata_sec->header.sh_size = sizeof(*ad);
  95. ad->__start___dbe_table = sec->header.sh_addr;