Re: Stripping in module

2005-07-25 Thread Christopher Allen Wing

Marco:

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


strip -g 


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
[EMAIL PROTECTED]



---
Budde, Marco  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.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: Stripping in module

2005-07-25 Thread Aleksey Gorelov
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: [EMAIL PROTECTED] 
>[mailto:[EMAIL PROTECTED] 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: ").
>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 [EMAIL PROTECTED]
>More majordomo info at  http://vger.kernel.org/majordomo-info.html
>Please read the FAQ at  http://www.tux.org/lkml/
>
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Stripping in module

2005-07-25 Thread Wakko Warner
Michael Tokarev wrote:
> Wakko Warner wrote:
> []
> > I would also be interested in this.  For instance the AIC7xxx driver has
> > every PCI id in the module I think in the .modinfo section which is not
> > truely required once depmod has been run. []
> 
> The .modinfo section, for example the PCI IDs, IS required for the
> module to function properly.  The kernel and the module uses that
> tables to determime which devices to work with, and with which paramteres.

I stripped out the section that had alias= and other vars from aic7xxx and
it still worked.  Not all modules worked doing that.

-- 
 Lab tests show that use of micro$oft causes cancer in lab animals
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Stripping in module

2005-07-25 Thread Michael Tokarev
Wakko Warner wrote:
[]
> I would also be interested in this.  For instance the AIC7xxx driver has
> every PCI id in the module I think in the .modinfo section which is not
> truely required once depmod has been run. []

The .modinfo section, for example the PCI IDs, IS required for the
module to function properly.  The kernel and the module uses that
tables to determime which devices to work with, and with which paramteres.

/mjt
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Stripping in module

2005-07-25 Thread Wakko Warner
Jan Engelhardt wrote:
> >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
> 
> Yes, I'd also be interested in what sections can actually be stripped, if any.
> Userspace shared libs for example can be `strip -s`'ed and they still work as 
> expected, does not look like this holds for kernel modules.

I would also be interested in this.  For instance the AIC7xxx driver has
every PCI id in the module I think in the .modinfo section which is not
truely required once depmod has been run.  I wanted to strip out this
information so that modules would be smaller.  I had stripped this section
out in testing a floppy boot and then most modules would not load anymore.

-- 
 Lab tests show that use of micro$oft causes cancer in lab animals
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Stripping in module

2005-07-25 Thread Jan Engelhardt
>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

Yes, I'd also be interested in what sections can actually be stripped, if any.
Userspace shared libs for example can be `strip -s`'ed and they still work as 
expected, does not look like this holds for kernel modules.



Jan Engelhardt
-- 
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Stripping in module

2005-07-25 Thread Budde, Marco
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: ").
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 [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Stripping in module

2005-07-25 Thread Budde, Marco
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: ).
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 [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Stripping in module

2005-07-25 Thread Jan Engelhardt
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

Yes, I'd also be interested in what sections can actually be stripped, if any.
Userspace shared libs for example can be `strip -s`'ed and they still work as 
expected, does not look like this holds for kernel modules.



Jan Engelhardt
-- 
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Stripping in module

2005-07-25 Thread Wakko Warner
Jan Engelhardt wrote:
 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
 
 Yes, I'd also be interested in what sections can actually be stripped, if any.
 Userspace shared libs for example can be `strip -s`'ed and they still work as 
 expected, does not look like this holds for kernel modules.

I would also be interested in this.  For instance the AIC7xxx driver has
every PCI id in the module I think in the .modinfo section which is not
truely required once depmod has been run.  I wanted to strip out this
information so that modules would be smaller.  I had stripped this section
out in testing a floppy boot and then most modules would not load anymore.

-- 
 Lab tests show that use of micro$oft causes cancer in lab animals
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Stripping in module

2005-07-25 Thread Michael Tokarev
Wakko Warner wrote:
[]
 I would also be interested in this.  For instance the AIC7xxx driver has
 every PCI id in the module I think in the .modinfo section which is not
 truely required once depmod has been run. []

The .modinfo section, for example the PCI IDs, IS required for the
module to function properly.  The kernel and the module uses that
tables to determime which devices to work with, and with which paramteres.

/mjt
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Stripping in module

2005-07-25 Thread Wakko Warner
Michael Tokarev wrote:
 Wakko Warner wrote:
 []
  I would also be interested in this.  For instance the AIC7xxx driver has
  every PCI id in the module I think in the .modinfo section which is not
  truely required once depmod has been run. []
 
 The .modinfo section, for example the PCI IDs, IS required for the
 module to function properly.  The kernel and the module uses that
 tables to determime which devices to work with, and with which paramteres.

I stripped out the section that had alias= and other vars from aic7xxx and
it still worked.  Not all modules worked doing that.

-- 
 Lab tests show that use of micro$oft causes cancer in lab animals
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: Stripping in module

2005-07-25 Thread Aleksey Gorelov
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: [EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED] 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: ).
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 [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Stripping in module

2005-07-25 Thread Christopher Allen Wing

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
[EMAIL PROTECTED]



---
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.

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/