[OpenWrt-Devel] [PATCH] Allow kernel modules to keep build ID debug symbol.

Felix Fietkau nbd at openwrt.org
Fri Oct 30 10:07:03 EDT 2015

On 2015-10-30 15:03, Toke Høiland-Jørgensen wrote:
> Felix Fietkau <nbd at openwrt.org> writes:
>> As far as I know, the build-id is build host specific, so I don't think
>> it will really help you with tracking versions of other people's
>> builds.
> Yup. But you can pass it explicitly to the linker:
> where PKG_SOURCE_VERSION is the git hash.
>> I think for what you're trying to do, it might be better to use
>> something else. You could just embed a custom section in your module
>> containing a git hash of the source tree, or something like that.
> Well the nice thing about this is that it requires very little change in
> other places: The facility to export it in sysfs is already in the
> kernel, and it's a one-line change to the build invocation (as above) to
> get it included.
> If you're opposed to adding this change, I guess that adding a custom
> note section to the module might be an alternative way to go about it;
> if I can figure out how to do that...
How about this: add it per-package, but add it in a way that you can set
PKG_BUILD_ID:=$(PKG_SOURCE_VERSION) and this will add the linker command
and disable the build-id stripping.

- Felix
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org

More information about the openwrt-devel mailing list