Re: [RFC PATCH 2/2] Kbuild: avoid partial linking of drivers/built-in.o

2015-04-01 Thread Dave Martin
On Tue, Mar 31, 2015 at 02:42:24PM -0400, Nicolas Pitre wrote: > On Tue, 31 Mar 2015, Dave Martin wrote: [...] > > We'd need to avoid pruning needed code that has no explicit caller, > > and functions that are part of the kernel/module ABI but not used > > within vmlinux. > > Those are usually l

Re: [RFC PATCH 2/2] Kbuild: avoid partial linking of drivers/built-in.o

2015-03-31 Thread Nicolas Pitre
On Tue, 31 Mar 2015, Russell King - ARM Linux wrote: > On Tue, Mar 31, 2015 at 05:27:22PM +0100, Dave Martin wrote: > > On Tue, Mar 31, 2015 at 11:22:29AM -0400, Nicolas Pitre wrote: > > > I'm using -ffunction-sections as well for the kernel size reduction work > > > I'm currently doing. The lin

Re: [RFC PATCH 2/2] Kbuild: avoid partial linking of drivers/built-in.o

2015-03-31 Thread Nicolas Pitre
On Tue, 31 Mar 2015, Dave Martin wrote: > On Tue, Mar 31, 2015 at 11:22:29AM -0400, Nicolas Pitre wrote: > > On Mon, 30 Mar 2015, Ard Biesheuvel wrote: > > > > > On 30 March 2015 at 16:13, Michal Marek wrote: > > [...] > > > > > What you could do is to add a Kconfig option to arch/arm/Kconfig

Re: [RFC PATCH 2/2] Kbuild: avoid partial linking of drivers/built-in.o

2015-03-31 Thread Russell King - ARM Linux
On Tue, Mar 31, 2015 at 05:27:22PM +0100, Dave Martin wrote: > On Tue, Mar 31, 2015 at 11:22:29AM -0400, Nicolas Pitre wrote: > > I'm using -ffunction-sections as well for the kernel size reduction work > > I'm currently doing. The linker script has to be adapted so .text.* is > > specified alon

Re: [RFC PATCH 2/2] Kbuild: avoid partial linking of drivers/built-in.o

2015-03-31 Thread Dave Martin
On Tue, Mar 31, 2015 at 11:22:29AM -0400, Nicolas Pitre wrote: > On Mon, 30 Mar 2015, Ard Biesheuvel wrote: > > > On 30 March 2015 at 16:13, Michal Marek wrote: [...] > > > What you could do is to add a Kconfig option to arch/arm/Kconfig adding > > > -ffunction-sections to the compiler flags. T

Re: [RFC PATCH 2/2] Kbuild: avoid partial linking of drivers/built-in.o

2015-03-31 Thread Nicolas Pitre
On Mon, 30 Mar 2015, Ard Biesheuvel wrote: > On 30 March 2015 at 16:13, Michal Marek wrote: > > On 2015-03-30 15:31, Ard Biesheuvel wrote: > >> On 30 March 2015 at 15:26, Russell King - ARM Linux > >> wrote: > >>> On Mon, Mar 30, 2015 at 02:38:35PM +0200, Michal Marek wrote: > Is this a lim

Re: [RFC PATCH 2/2] Kbuild: avoid partial linking of drivers/built-in.o

2015-03-30 Thread Ard Biesheuvel
On 30 March 2015 at 16:13, Michal Marek wrote: > On 2015-03-30 15:31, Ard Biesheuvel wrote: >> On 30 March 2015 at 15:26, Russell King - ARM Linux >> wrote: >>> On Mon, Mar 30, 2015 at 02:38:35PM +0200, Michal Marek wrote: Is this a limitation of a particular ARM ABI or a limitation of a sta

Re: [RFC PATCH 2/2] Kbuild: avoid partial linking of drivers/built-in.o

2015-03-30 Thread Michal Marek
On 2015-03-30 15:31, Ard Biesheuvel wrote: > On 30 March 2015 at 15:26, Russell King - ARM Linux > wrote: >> On Mon, Mar 30, 2015 at 02:38:35PM +0200, Michal Marek wrote: >>> Is this a limitation of a particular ARM ABI or a limitation of a state >>> of the art ARM linker or something else? >> >>

Re: [RFC PATCH 2/2] Kbuild: avoid partial linking of drivers/built-in.o

2015-03-30 Thread Ard Biesheuvel
On 30 March 2015 at 15:26, Russell King - ARM Linux wrote: > On Mon, Mar 30, 2015 at 02:38:35PM +0200, Michal Marek wrote: >> Is this a limitation of a particular ARM ABI or a limitation of a state >> of the art ARM linker or something else? > > It's a limitation of the ARM ISA. > > Normal PC-rela

Re: [RFC PATCH 2/2] Kbuild: avoid partial linking of drivers/built-in.o

2015-03-30 Thread Russell King - ARM Linux
On Mon, Mar 30, 2015 at 02:38:35PM +0200, Michal Marek wrote: > Is this a limitation of a particular ARM ABI or a limitation of a state > of the art ARM linker or something else? It's a limitation of the ARM ISA. Normal PC-relative branches, which are emitted by the C compiler, can branch +/- 32M

Re: [RFC PATCH 2/2] Kbuild: avoid partial linking of drivers/built-in.o

2015-03-30 Thread Ard Biesheuvel
On 30 March 2015 at 14:38, Michal Marek wrote: > On 2015-03-30 13:49, Ard Biesheuvel wrote: >> The recursive partial linking of vmlinux can result in a >> drivers/built-in.o that is so huge that it interferes with >> the ability of the linker to emit veneers in the final link >> stage if the symbo

Re: [RFC PATCH 2/2] Kbuild: avoid partial linking of drivers/built-in.o

2015-03-30 Thread Michal Marek
On 2015-03-30 13:49, Ard Biesheuvel wrote: > The recursive partial linking of vmlinux can result in a > drivers/built-in.o that is so huge that it interferes with > the ability of the linker to emit veneers in the final link > stage if the symbols are out of reach. This is caused by the > fact that

[RFC PATCH 2/2] Kbuild: avoid partial linking of drivers/built-in.o

2015-03-30 Thread Ard Biesheuvel
The recursive partial linking of vmlinux can result in a drivers/built-in.o that is so huge that it interferes with the ability of the linker to emit veneers in the final link stage if the symbols are out of reach. This is caused by the fact that those veneers, which should be emitted close enough