mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-13 10:02:38 +00:00
symorder appears to have been designed to run on executable files
only, as it payes no attention to the relocation table (which references the symbols). As a result, running "symorder -c" to clean up the visibility of a LKM ".o" file (as is done in the new bsd.kmod.mk) totally screws up the relocation table, making the LKM file unloadable. (ld: bogus relocation record) This is a pretty crude fix - I've changed symorder so that when running in "cleanup" mode, it disables the reordering which was screwing up the relocation table. I'm sure there is a better fix, but I didn't have the energy. Feel free to fix this hack, probably by renumbering the symbol indexes in the relocation table.
This commit is contained in:
parent
25c3d35121
commit
62c10d2dcb
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=11856
@ -185,15 +185,19 @@ main(argc, argv)
|
||||
strtabsize - sizeof(int))
|
||||
badfmt("corrupted string table");
|
||||
|
||||
newtab = (struct nlist *)malloc(n);
|
||||
if (newtab == (struct nlist *)NULL)
|
||||
error(NULL);
|
||||
memset(newtab, 0, n);
|
||||
|
||||
i = n / sizeof(struct nlist);
|
||||
reorder(symtab, newtab, i);
|
||||
free((void *)symtab);
|
||||
symtab = newtab;
|
||||
if (!clean) {
|
||||
newtab = (struct nlist *)malloc(n);
|
||||
if (newtab == (struct nlist *)NULL)
|
||||
error(NULL);
|
||||
memset(newtab, 0, n);
|
||||
|
||||
reorder(symtab, newtab, i);
|
||||
free((void *)symtab);
|
||||
symtab = newtab;
|
||||
} else {
|
||||
symfound = symkept = i;
|
||||
}
|
||||
|
||||
newstrings = malloc(strtabsize);
|
||||
if (newstrings == NULL)
|
||||
|
Loading…
Reference in New Issue
Block a user