FreeBSD Bugzilla – Attachment 2594 Details for
Bug 7779
[PATCH] modload should detect stripped kernels and use consistent option names
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 4.27 KB, created by
rotel
on 1998-08-29 23:30:01 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
rotel
Created:
1998-08-29 23:30:01 UTC
Size:
4.27 KB
patch
obsolete
>Index: modload.8 >=================================================================== >RCS file: /cvs/src/sbin/modload/modload.8,v >retrieving revision 1.11 >diff -c -r1.11 modload.8 >*** modload.8 1998/03/19 07:45:37 1.11 >--- modload.8 1998/08/29 22:11:08 >*************** >*** 34,40 **** > .Sh SYNOPSIS > .Nm modload > .Op Fl dquv >! .Op Fl A Ar kernel > .Op Fl e Ar entry > .Op Fl p Ar postinstall > .Op Fl o Ar output_file >--- 34,40 ---- > .Sh SYNOPSIS > .Nm modload > .Op Fl dquv >! .Op Fl N Ar kernel > .Op Fl e Ar entry > .Op Fl p Ar postinstall > .Op Fl o Ar output_file >*************** >*** 62,72 **** > temporary file to be kept rather than deleted. > .It Fl v > Print comments about the loading process. >! .It Fl A Ar kernel > Specify the file that is passed to the linker > to resolve module references to external symbols. > The symbol file must be for the currently running > kernel or the module is likely to crash the system. > .It Fl e Ar entry > Specify the module entry point. > This is passed by >--- 62,75 ---- > temporary file to be kept rather than deleted. > .It Fl v > Print comments about the loading process. >! .It Fl N Ar kernel > Specify the file that is passed to the linker > to resolve module references to external symbols. > The symbol file must be for the currently running > kernel or the module is likely to crash the system. >+ The option >+ .Fl A >+ is synonymous and provided for backwards compatability. > .It Fl e Ar entry > Specify the module entry point. > This is passed by >Index: modload.c >=================================================================== >RCS file: /cvs/src/sbin/modload/modload.c,v >retrieving revision 1.23 >diff -c -r1.23 modload.c >*** modload.c 1998/08/12 02:39:23 1.23 >--- modload.c 1998/08/29 22:11:10 >*************** >*** 62,68 **** > /* > * Expected linker options: > * >! * -A executable to link against > * -e entry point > * -o output file > * -T address to link to in hex (assumes it's a page boundry) >--- 62,68 ---- > /* > * Expected linker options: > * >! * -N executable to link against > * -e entry point > * -o output file > * -T address to link to in hex (assumes it's a page boundry) >*************** >*** 78,89 **** > char addrbuf[32], entrybuf[_POSIX2_LINE_MAX]; > pid_t pid; > int status; > > snprintf(entrybuf, sizeof entrybuf, "_%s", entry); > snprintf(addrbuf, sizeof addrbuf, "%x", address); > > if (debug) >! printf("%s -A %s -e %s -o %s -T %s %s\n", > _PATH_LD, kernel, entrybuf, outfile, > addrbuf, object); > >--- 78,100 ---- > char addrbuf[32], entrybuf[_POSIX2_LINE_MAX]; > pid_t pid; > int status; >+ struct exec se; >+ int fd; >+ >+ if ( (fd = open(kernel, O_RDONLY, 0)) < 0) >+ err(1, "open: %s", kernel); >+ >+ if (read(fd, &se, sizeof(se)) != sizeof(se)) >+ errx(1, "cannot read exec structure: file too small: %s", kernel); >+ >+ if (se.a_syms == 0) >+ errx(1, "cannot load module: no debugging symbols found in %s", kernel); > > snprintf(entrybuf, sizeof entrybuf, "_%s", entry); > snprintf(addrbuf, sizeof addrbuf, "%x", address); > > if (debug) >! printf("%s -N %s -e %s -o %s -T %s %s\n", > _PATH_LD, kernel, entrybuf, outfile, > addrbuf, object); > >*************** >*** 121,127 **** > { > > fprintf(stderr, >! "usage: modload [-d] [-v] [-q] [-u] [-A <kernel>] [-e <entry]\n"); > fprintf(stderr, > " [-p <postinstall>] [-o <output file>] <input file>\n"); > exit(1); >--- 132,138 ---- > { > > fprintf(stderr, >! "usage: modload [-d] [-v] [-q] [-u] [-N <kernel>] [-e <entry]\n"); > fprintf(stderr, > " [-p <postinstall>] [-o <output file>] <input file>\n"); > exit(1); >*************** >*** 174,180 **** > int sz, bytesleft; > char buf[MODIOBUF]; > >! while ((c = getopt(argc, argv, "dvquA:e:p:o:")) != -1) { > switch (c) { > case 'd': > debug = 1; >--- 185,191 ---- > int sz, bytesleft; > char buf[MODIOBUF]; > >! while ((c = getopt(argc, argv, "dvquA:N:e:p:o:")) != -1) { > switch (c) { > case 'd': > debug = 1; >*************** >*** 188,194 **** > case 'q': > quiet = 1; > break; >! case 'A': > kname = optarg; > break; /* kernel */ > case 'e': >--- 199,206 ---- > case 'q': > quiet = 1; > break; >! case 'A': /* deprecated, use -N */ >! case 'N': > kname = optarg; > break; /* kernel */ > case 'e':
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 7779
: 2594