Page MenuHomeFreeBSD

Correct module symbol export handling
ClosedPublic

Authored by emaste on Feb 9 2018, 6:43 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Nov 21, 4:15 AM
Unknown Object (File)
Fri, Nov 21, 4:13 AM
Unknown Object (File)
Fri, Nov 21, 4:12 AM
Unknown Object (File)
Fri, Nov 21, 4:11 AM
Unknown Object (File)
Fri, Nov 21, 4:09 AM
Unknown Object (File)
Wed, Nov 19, 3:52 AM
Unknown Object (File)
Tue, Nov 18, 10:27 PM
Unknown Object (File)
Tue, Nov 18, 4:24 PM
Subscribers

Details

Summary

EXPORT_SYMS can be set to YES, NO, a list of symbols to export from a module, or to a filename containing such a list. For the case that it is set to a symbol list, replace spaces in the list with newlines, so the created file is in the format expected by kmod_syms.awk.

Sponsored by: Turing Robotic Industries Inc.

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

This revision is now accepted and ready to land.Feb 9 2018, 7:00 PM
emaste added a subscriber: stevek.

Microoptimize away a fork+exec of tr, from @stevek

This revision now requires review to proceed.Feb 9 2018, 7:08 PM

Looks ok to me. Did you have a test kernel module you used to test this?

In D14284#300389, @jhb wrote:

Looks ok to me. Did you have a test kernel module you used to test this?

I discovered this while trying to test an in-progress arm64 linuxolator port, observed by comparing symbols listed in readelf -s / nm -D with what I expected. I'll see about adding an explicit test module to demonstrate the issue, although the fact that amd64 uses .o kernel modules is a confounding issue.

I was just curious, I don't think there's probably a need to make a test module (though having a real test for this might be nice). I had figured you had run into it somehow and was wondering if that somehow had turned into an easy test to verify correctness. :)

This revision is now accepted and ready to land.Feb 12 2018, 9:55 PM
In D14284#300508, @jhb wrote:

I was just curious, I don't think there's probably a need to make a test module (though having a real test for this might be nice). I had figured you had run into it somehow and was wondering if that somehow had turned into an easy test to verify correctness. :)

It's proved difficult to verify end-to-end behaviour, because symbol handling in our kernel loader is somewhat wonky; depending on architecture symbols may come from .dynsym or .symtab.

This revision was automatically updated to reflect the committed changes.