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

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 located

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

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

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.

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

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 mma...@suse.cz wrote: On 2015-03-30 15:31, Ard Biesheuvel wrote: On 30 March 2015 at 15:26, Russell King - ARM Linux li...@arm.linux.org.uk wrote: On Mon, Mar 30, 2015 at 02:38:35PM +0200, Michal Marek

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 mma...@suse.cz wrote: [...] What you could do is to add a Kconfig option to arch/arm/Kconfig adding -ffunction-sections to the compiler

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 along

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 mma...@suse.cz 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 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 linker

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

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

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 +/-

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

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

[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

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

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 li...@arm.linux.org.uk 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.

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 +/- 32MB

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 mma...@suse.cz 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

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 li...@arm.linux.org.uk 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

[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

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 mma...@suse.cz wrote: On 2015-03-30 15:31, Ard Biesheuvel wrote: On 30 March 2015 at 15:26, Russell King - ARM Linux li...@arm.linux.org.uk wrote: On Mon, Mar 30, 2015 at 02:38:35PM +0200, Michal Marek wrote: Is this a limitation of a particular ARM ABI