mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Stripping in module
@ 2005-07-25  6:23 Budde, Marco
  2005-07-25  7:29 ` Jan Engelhardt
  0 siblings, 1 reply; 7+ messages in thread
From: Budde, Marco @ 2005-07-25  6:23 UTC (permalink / raw)
  To: linux-kernel

Hi,

at the moment I am packaging a Linux module as an RPM archive.

Therefor I would like to remove some of the not exported/needed
symbols (like e.g. static functions or constants) from the
Linux module.

What is the best way to do this with v2.6.

I have tried e.g. to remove all symbols starting with "telos"
from the module like this (after kbuild):

  strip -w -K '!telos*' -K 'telosi2c_usb_driver' telosi2c_linux.ko

When I try to load such a module, insmod dies with a segmentation
fault or the complete kernel dies (with "invalid operand: 0000").
What is the reason for this problem?

What is the correct way using kbuild to remove some symbols?

cu, Marco


^ permalink raw reply	[flat|nested] 7+ messages in thread
* RE: Stripping in module
@ 2005-07-25 16:14 Aleksey Gorelov
  0 siblings, 0 replies; 7+ messages in thread
From: Aleksey Gorelov @ 2005-07-25 16:14 UTC (permalink / raw)
  To: Budde, Marco, linux-kernel

Well, the best you can do is
strip -R .note -R .comment --strip-unneeded.

 If you go for more, module might not be loaded/initialized properlly

Aleks.

>-----Original Message-----
>From: linux-kernel-owner@vger.kernel.org 
>[mailto:linux-kernel-owner@vger.kernel.org] On Behalf Of Budde, Marco
>Sent: Sunday, July 24, 2005 11:24 PM
>To: linux-kernel@vger.kernel.org
>Subject: Stripping in module
>
>Hi,
>
>at the moment I am packaging a Linux module as an RPM archive.
>
>Therefor I would like to remove some of the not exported/needed
>symbols (like e.g. static functions or constants) from the
>Linux module.
>
>What is the best way to do this with v2.6.
>
>I have tried e.g. to remove all symbols starting with "telos"
>from the module like this (after kbuild):
>
>  strip -w -K '!telos*' -K 'telosi2c_usb_driver' telosi2c_linux.ko
>
>When I try to load such a module, insmod dies with a segmentation
>fault or the complete kernel dies (with "invalid operand: 0000").
>What is the reason for this problem?
>
>What is the correct way using kbuild to remove some symbols?
>
>cu, Marco
>
>-
>To unsubscribe from this list: send the line "unsubscribe 
>linux-kernel" in
>the body of a message to majordomo@vger.kernel.org
>More majordomo info at  http://vger.kernel.org/majordomo-info.html
>Please read the FAQ at  http://www.tux.org/lkml/
>

^ permalink raw reply	[flat|nested] 7+ messages in thread
* Re: Stripping in module
@ 2005-07-25 17:18 Christopher Allen Wing
  0 siblings, 0 replies; 7+ messages in thread
From: Christopher Allen Wing @ 2005-07-25 17:18 UTC (permalink / raw)
  To: Budde, Marco; +Cc: linux-kernel

Marco:

FWIW, the Red Hat kernel RPMs effectively do the following when they 
package kernel modules:

 	strip -g <module.ko>


This is done via the script:

 	/usr/lib/rpm/brp-strip


which is implicitly run on all executable files packaged in the RPM.


If you ensure that the module .ko file is executable, then RPM will strip 
it for you automatically.


-Chris Wing
wingc@engin.umich.edu



---
Budde, Marco <budde_at_telos.de> wrote:

> Hi,
> 
> at the moment I am packaging a Linux module as an RPM archive.
> 
> Therefor I would like to remove some of the not exported/needed
> symbols (like e.g. static functions or constants) from the
> Linux module.
> 
> What is the best way to do this with v2.6.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2005-07-25 17:18 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-07-25  6:23 Stripping in module Budde, Marco
2005-07-25  7:29 ` Jan Engelhardt
2005-07-25 11:26   ` Wakko Warner
2005-07-25 11:23     ` Michael Tokarev
2005-07-25 16:27       ` Wakko Warner
2005-07-25 16:14 Aleksey Gorelov
2005-07-25 17:18 Christopher Allen Wing

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®