diff -Nur modutils-2.4.4/ChangeLog modutils-2.4.5/ChangeLog --- modutils-2.4.4/ChangeLog Mon Mar 26 19:29:56 2001 +++ modutils-2.4.5/ChangeLog Wed Mar 28 20:49:06 2001 @@ -1,3 +1,13 @@ +2001-03-29 Keith Owens + + modutils 2.4.5 + + * Use tgt_long in kernel structures. Dave Miller. + * Correct format for generic strings. + * Print modinfo filename before parameters. + * Print modinfo output in machine parsable format. + * Support for SEGREL32 relocs on hppa/hppa64. Richard Hirst. + 2001-03-26 Keith Owens modutils 2.4.4 diff -Nur modutils-2.4.4/depmod/depmod.c modutils-2.4.5/depmod/depmod.c --- modutils-2.4.4/depmod/depmod.c Tue Jan 23 05:13:16 2001 +++ modutils-2.4.5/depmod/depmod.c Tue Mar 27 23:03:32 2001 @@ -23,7 +23,7 @@ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ident "$Id: depmod.c 1.3 Tue, 23 Jan 2001 05:13:16 +1100 kaos $" +#ident "$Id: depmod.c 1.5 Tue, 27 Mar 2001 23:03:32 +1000 kaos $" #include #include @@ -168,7 +168,7 @@ /* * for driver's use; not involved in driver matching. */ - unsigned long driver_info; + unsigned tgt_long driver_info; }; /* Supplied by Adam J. Richter, approx 2.4.0-test13, modified by KAO. @@ -1100,7 +1100,7 @@ if (l1 < 20) l1 = 20; l -= (l1+1); - fprintf(generic_string, "%*s\n", l, *pstr); + fprintf(generic_string, "%.*s\n", l, *pstr); } } diff -Nur modutils-2.4.4/include/version.h modutils-2.4.5/include/version.h --- modutils-2.4.4/include/version.h Wed Feb 28 22:57:37 2001 +++ modutils-2.4.5/include/version.h Mon Mar 26 22:02:35 2001 @@ -1 +1 @@ -#define MODUTILS_VERSION "2.4.4" +#define MODUTILS_VERSION "2.4.5" diff -Nur modutils-2.4.4/insmod/modinfo.c modutils-2.4.5/insmod/modinfo.c --- modutils-2.4.4/insmod/modinfo.c Sun Mar 25 21:13:48 2001 +++ modutils-2.4.5/insmod/modinfo.c Wed Mar 28 20:49:06 2001 @@ -33,7 +33,7 @@ * Keith Owens November 2000. */ -#ident "$Id: modinfo.c 1.3 Sun, 25 Mar 2001 21:13:48 +1000 kaos $" +#ident "$Id: modinfo.c 1.6 Wed, 28 Mar 2001 20:49:06 +1000 kaos $" #include #include @@ -131,23 +131,70 @@ return NULL; } +/* Most fields are fixed format which makes it relatively easy for programs to + * parse the output from modinfo. But description and author fields can be + * multi line and can contain any characters. To make it possible to parse the + * modinfo output, fields that might be multi line are printed enclosed in '"' + * for human readability and embedded newlines are printed as "\n " so the + * second and subsequent lines are always indented. + */ + static int append_modinfo_tag(struct obj_file *f, char *tag, char *def, - char **out_str, int n) + char **out_str, int n, int multi_line) { - const char *p; + const char *p, *p1; + int extra = 0, l; p = get_modinfo_value(f, tag); if (!p && !def) return -1; - if (!p) + if (!p) { p = def; + multi_line = 0; + } + + if (multi_line) { + p1 = p; + extra = 2; + while ((p1 = strchr(p1, '\n'))) { + extra += 2; + ++p1; + } + } - if (strlen(p) < n) - n = strlen(p); + if (strlen(p)+extra < n) + n = strlen(p)+extra; - strncpy(*out_str, p, n); - *out_str += n; + if (!multi_line || n <= 2) { + strncpy(*out_str, p, n); + *out_str += n; + } + else { + *(*out_str)++ = '"'; + n -= 2; + p1 = p; + while (*p1) { + p1 = strchr(p, '\n'); + if (p1) + ++p1; + else + p1 = p + strlen(p); + l = p1 - p; + if (l > n) + l = n; + strncpy(*out_str, p, l); + n -= l; + *out_str += l; + if (*(p1-1) == '\n' && n >= 2) { + strncpy(*out_str, " ", 2); + *out_str += 2; + n -= 2; + } + p = p1; + } + *(*out_str)++ = '"'; + } return 0; } @@ -189,21 +236,22 @@ case 'a': (void) append_modinfo_tag(f, "author", "", - &out_str, last_char - out_str); + &out_str, last_char - out_str, 1); break; case 'd': (void) append_modinfo_tag(f, "description", "", - &out_str, last_char - out_str); + &out_str, last_char - out_str, 1); break; case 'n': (void) append_modinfo_tag(f, "filename", "", - &out_str, last_char - out_str); + &out_str, last_char - out_str, 0); break; case '{':{ char tag[128], *end = strchr(in_str, '}'); + int multi_line; /* Make sure the %{...} is formatted correctly. */ if (!end) { @@ -218,9 +266,11 @@ memset(tag, 0, sizeof(tag)); strncpy(tag, in_str, end - in_str); tag[end - in_str] = '\0'; + multi_line = strcmp(tag, "author") == 0 || + strcmp(tag, "description") == 0; /* Append the tag's value if it exists. */ - append_modinfo_tag(f, tag, "", &out_str, last_char - out_str); + append_modinfo_tag(f, tag, "", &out_str, last_char - out_str, multi_line); /* Advance past the end of the replacement. */ in_str = end + 1; @@ -260,7 +310,7 @@ if (max < min) printf("warning: parameter %s has max < min!\n", key); - printf("%s ", key); + printf("parm: %s ", key); switch (*p) { case 'c': @@ -308,8 +358,23 @@ if (min > 1 || max > 1) printf(" array (min = %d, max = %d)", min, max); - if (desc) - printf(", description \"%s\"", desc); + if (desc && *desc) { + const char *p = desc, *p1; + printf(", description \""); + p1 = p; + while (*p1) { + p1 = strchr(p, '\n'); + if (p1) + ++p1; + else + p1 = p + strlen(p); + printf("%.*s", p1 - p, p); + if (*(p1-1) == '\n') + printf(" "); + p = p1; + } + printf("\""); + } printf("\n"); } @@ -383,14 +448,14 @@ return -1; gzf_close(fp); - if (do_parameters) { - show_module_parameters(f); - } if (fmtstr) { p = format_query_string(f, fmtstr); if (p) fputs(p, stdout); } + if (do_parameters) { + show_module_parameters(f); + } return 0; } @@ -442,7 +507,7 @@ {0, 0, 0, 0} }; int do_parameters = 1, opt; - char *fmtstr = "filename - %n\ndescription - %d\nauthor - %a\n"; + char *fmtstr = "filename: %n\ndescription: %d\nauthor: %a\n"; while ((opt = getopt_long(argc, argv, "adnq:pf:Vh", long_opts, NULL)) != EOF) switch (opt) { diff -Nur modutils-2.4.4/modutils.spec modutils-2.4.5/modutils.spec --- modutils-2.4.4/modutils.spec Wed Feb 28 22:57:37 2001 +++ modutils-2.4.5/modutils.spec Mon Mar 26 22:02:35 2001 @@ -1,6 +1,6 @@ Summary: Module utilities Name: modutils -Version: 2.4.4 +Version: 2.4.5 Release: 1 Copyright: GPL Group: Utilities/System diff -Nur modutils-2.4.4/obj/obj_hppa.c modutils-2.4.5/obj/obj_hppa.c --- modutils-2.4.4/obj/obj_hppa.c Sun Mar 25 21:13:48 2001 +++ modutils-2.4.5/obj/obj_hppa.c Wed Mar 28 20:49:06 2001 @@ -529,6 +529,10 @@ /* Easy. */ break; + case R_PARISC_SEGREL32: + v -= f->baseaddr; + break; + case R_PARISC_DPREL21L: case R_PARISC_DPREL14R: v -= dp; @@ -566,9 +570,10 @@ case R_PARISC_DIR32: case R_PARISC_PLABEL32: case R_PARISC_PCREL17F: + case R_PARISC_SEGREL32: fsel = e_fsel; break; - + case R_PARISC_DPREL21L: case R_PARISC_DIR21L: fsel = e_lrsel; @@ -602,6 +607,7 @@ { case R_PARISC_DIR32: case R_PARISC_PLABEL32: + case R_PARISC_SEGREL32: r_format = 32; break; diff -Nur modutils-2.4.4/obj/obj_hppa64.c modutils-2.4.5/obj/obj_hppa64.c --- modutils-2.4.4/obj/obj_hppa64.c Fri Jan 5 12:45:19 2001 +++ modutils-2.4.5/obj/obj_hppa64.c Wed Mar 28 20:49:06 2001 @@ -22,7 +22,7 @@ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ident "$Id: obj_hppa64.c 1.1 Fri, 05 Jan 2001 12:45:19 +1100 kaos $" +#ident "$Id: obj_hppa64.c 1.2 Wed, 28 Mar 2001 20:49:06 +1000 kaos $" #include #include @@ -361,6 +361,7 @@ need_stub = TRUE; break; case R_PARISC_DIR64: + case R_PARISC_SEGREL32: break; case R_PARISC_FPTR64: /* This is a simple OPD entry (only created for local symbols, @@ -595,6 +596,11 @@ { loc[0] = v >> 32; loc[1] = v; + } + break; + case R_PARISC_SEGREL32: + { + loc[0] = v - f->baseaddr; } break; case R_PARISC_FPTR64: