Linux MIPS Architecture development
 help / color / mirror / Atom feed
* Re: Lots of unexpected non-allocatable section warnings
       [not found]       ` <20090503202939.GA1237@uranus.ravnborg.org>
@ 2009-05-04  8:28         ` Manuel Lauss
  2009-05-04  9:49           ` Sam Ravnborg
  2009-05-04 15:26           ` David Daney
  0 siblings, 2 replies; 5+ messages in thread
From: Manuel Lauss @ 2009-05-04  8:28 UTC (permalink / raw)
  To: Sam Ravnborg; +Cc: Anders Kaseorg, LKML, Linux-MIPS

Hi Sam,

On Sun, May 03, 2009 at 10:29:39PM +0200, Sam Ravnborg wrote:
> This is due to the SUSE specific section as you expected.
> We ignore sections named ".comment" but not ".comment" sections
> with something appended to the name.


On a related note, I see tons of the following warnings cross-building for
MIPS:

WARNING: init/mounts.o (.mdebug.abi32): unexpected non-allocatable section.
Did you forget to use "ax"/"aw" in a .S file?                              
Note that for example <linux/init.h> contains                              
section definitions for use in .S files.                                   

WARNING: init/mounts.o (.pdr): unexpected non-allocatable section.
Did you forget to use "ax"/"aw" in a .S file?                     
Note that for example <linux/init.h> contains                     
section definitions for use in .S files. 


I added ".pdr" and ".mdebug*" to the whitelist;  the resulting kernels still
work.  (gcc-4.3.3, binutils-2.19.1)

Thanks!
	Manuel Lauss

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

* Re: Lots of unexpected non-allocatable section warnings
  2009-05-04  8:28         ` Lots of unexpected non-allocatable section warnings Manuel Lauss
@ 2009-05-04  9:49           ` Sam Ravnborg
  2009-05-04 10:05             ` Manuel Lauss
  2009-05-04 15:24             ` David Daney
  2009-05-04 15:26           ` David Daney
  1 sibling, 2 replies; 5+ messages in thread
From: Sam Ravnborg @ 2009-05-04  9:49 UTC (permalink / raw)
  To: Manuel Lauss; +Cc: Anders Kaseorg, LKML, Linux-MIPS

On Mon, May 04, 2009 at 10:28:16AM +0200, Manuel Lauss wrote:
> Hi Sam,
> 
> On Sun, May 03, 2009 at 10:29:39PM +0200, Sam Ravnborg wrote:
> > This is due to the SUSE specific section as you expected.
> > We ignore sections named ".comment" but not ".comment" sections
> > with something appended to the name.
> 
> 
> On a related note, I see tons of the following warnings cross-building for
> MIPS:
> 
> WARNING: init/mounts.o (.mdebug.abi32): unexpected non-allocatable section.
> Did you forget to use "ax"/"aw" in a .S file?                              
> Note that for example <linux/init.h> contains                              
> section definitions for use in .S files.                                   
> 
> WARNING: init/mounts.o (.pdr): unexpected non-allocatable section.
> Did you forget to use "ax"/"aw" in a .S file?                     
> Note that for example <linux/init.h> contains                     
> section definitions for use in .S files. 
> 
> 
> I added ".pdr" and ".mdebug*" to the whitelist;  the resulting kernels still
> work.  (gcc-4.3.3, binutils-2.19.1)

Hi Manuel - thanks for reporting!

Is your mips target little or big endian?
If it is a big-endian target (which I expect) then the right fix
is the patch posted by Anders.

In other words - what happens if you back out your change
and apply the appended patch.

	Sam

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

* Re: Lots of unexpected non-allocatable section warnings
  2009-05-04  9:49           ` Sam Ravnborg
@ 2009-05-04 10:05             ` Manuel Lauss
  2009-05-04 15:24             ` David Daney
  1 sibling, 0 replies; 5+ messages in thread
From: Manuel Lauss @ 2009-05-04 10:05 UTC (permalink / raw)
  To: Sam Ravnborg; +Cc: Anders Kaseorg, LKML, Linux-MIPS

Hi Sam,

On Mon, May 04, 2009 at 11:49:28AM +0200, Sam Ravnborg wrote:
> On Mon, May 04, 2009 at 10:28:16AM +0200, Manuel Lauss wrote:
> > Hi Sam,
> > 
> > On Sun, May 03, 2009 at 10:29:39PM +0200, Sam Ravnborg wrote:
> > > This is due to the SUSE specific section as you expected.
> > > We ignore sections named ".comment" but not ".comment" sections
> > > with something appended to the name.
> > 
> > 
> > On a related note, I see tons of the following warnings cross-building for
> > MIPS:
> > 
> > WARNING: init/mounts.o (.mdebug.abi32): unexpected non-allocatable section.
> > Did you forget to use "ax"/"aw" in a .S file?                              
> > Note that for example <linux/init.h> contains                              
> > section definitions for use in .S files.                                   
> > 
> > WARNING: init/mounts.o (.pdr): unexpected non-allocatable section.
> > Did you forget to use "ax"/"aw" in a .S file?                     
> > Note that for example <linux/init.h> contains                     
> > section definitions for use in .S files. 
> > 
> > 
> > I added ".pdr" and ".mdebug*" to the whitelist;  the resulting kernels still
> > work.  (gcc-4.3.3, binutils-2.19.1)
> 
> Hi Manuel - thanks for reporting!
> 
> Is your mips target little or big endian?
> If it is a big-endian target (which I expect) then the right fix
> is the patch posted by Anders.

No, it's little-endian.  Cross-compiling on x86_64 to mipsel.

 
> In other words - what happens if you back out your change
> and apply the appended patch.

no change.

(Did you attach the wrong patch?  It does indentation fixes and adds a few
more entries)

Thanks!
	Manuel Lauss

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

* Re: Lots of unexpected non-allocatable section warnings
  2009-05-04  9:49           ` Sam Ravnborg
  2009-05-04 10:05             ` Manuel Lauss
@ 2009-05-04 15:24             ` David Daney
  1 sibling, 0 replies; 5+ messages in thread
From: David Daney @ 2009-05-04 15:24 UTC (permalink / raw)
  To: Sam Ravnborg; +Cc: Manuel Lauss, Anders Kaseorg, LKML, Linux-MIPS

Sam Ravnborg wrote:

> From: Anders Kaseorg <andersk@MIT.EDU>
> Date: Sun, 3 May 2009 22:02:55 +0200
> Subject: [PATCH 1/2] kbuild, modpost: fix unexpected non-allocatable section when cross compiling
> 
> The missing TO_NATIVE(sechdrs[i].sh_flags) was causing many
> unexpected non-allocatable section warnings when cross-compiling
> for an architecture with a different endianness.
> 
> Fix endianness of all the fields in the ELF header and
> section headers, not just some of them so we are not
> hit by this anohter time.
> 
> Signed-off-by: Anders Kaseorg <andersk@mit.edu>
> Reported-by: Sean MacLennan <smaclennan@pikatech.com>
> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>

Acked-by: David Daney <ddaney@caviumnetworks.com>

This is essentially what I did in my local tree to fix the problems.


> ---
>  scripts/mod/modpost.c |   35 +++++++++++++++++++++++------------
>  1 files changed, 23 insertions(+), 12 deletions(-)
> 
> diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
> index 936b6f8..a5c17db 100644
> --- a/scripts/mod/modpost.c
> +++ b/scripts/mod/modpost.c
> @@ -384,11 +384,19 @@ static int parse_elf(struct elf_info *info, const char *filename)
>  		return 0;
>  	}
>  	/* Fix endianness in ELF header */
> -	hdr->e_shoff    = TO_NATIVE(hdr->e_shoff);
> -	hdr->e_shstrndx = TO_NATIVE(hdr->e_shstrndx);
> -	hdr->e_shnum    = TO_NATIVE(hdr->e_shnum);
> -	hdr->e_machine  = TO_NATIVE(hdr->e_machine);
> -	hdr->e_type     = TO_NATIVE(hdr->e_type);
> +	hdr->e_type      = TO_NATIVE(hdr->e_type);
> +	hdr->e_machine   = TO_NATIVE(hdr->e_machine);
> +	hdr->e_version   = TO_NATIVE(hdr->e_version);
> +	hdr->e_entry     = TO_NATIVE(hdr->e_entry);
> +	hdr->e_phoff     = TO_NATIVE(hdr->e_phoff);
> +	hdr->e_shoff     = TO_NATIVE(hdr->e_shoff);
> +	hdr->e_flags     = TO_NATIVE(hdr->e_flags);
> +	hdr->e_ehsize    = TO_NATIVE(hdr->e_ehsize);
> +	hdr->e_phentsize = TO_NATIVE(hdr->e_phentsize);
> +	hdr->e_phnum     = TO_NATIVE(hdr->e_phnum);
> +	hdr->e_shentsize = TO_NATIVE(hdr->e_shentsize);
> +	hdr->e_shnum     = TO_NATIVE(hdr->e_shnum);
> +	hdr->e_shstrndx  = TO_NATIVE(hdr->e_shstrndx);
>  	sechdrs = (void *)hdr + hdr->e_shoff;
>  	info->sechdrs = sechdrs;
>  
> @@ -402,13 +410,16 @@ static int parse_elf(struct elf_info *info, const char *filename)
>  
>  	/* Fix endianness in section headers */
>  	for (i = 0; i < hdr->e_shnum; i++) {
> -		sechdrs[i].sh_type   = TO_NATIVE(sechdrs[i].sh_type);
> -		sechdrs[i].sh_offset = TO_NATIVE(sechdrs[i].sh_offset);
> -		sechdrs[i].sh_size   = TO_NATIVE(sechdrs[i].sh_size);
> -		sechdrs[i].sh_link   = TO_NATIVE(sechdrs[i].sh_link);
> -		sechdrs[i].sh_name   = TO_NATIVE(sechdrs[i].sh_name);
> -		sechdrs[i].sh_info   = TO_NATIVE(sechdrs[i].sh_info);
> -		sechdrs[i].sh_addr   = TO_NATIVE(sechdrs[i].sh_addr);
> +		sechdrs[i].sh_name      = TO_NATIVE(sechdrs[i].sh_name);
> +		sechdrs[i].sh_type      = TO_NATIVE(sechdrs[i].sh_type);
> +		sechdrs[i].sh_flags     = TO_NATIVE(sechdrs[i].sh_flags);
> +		sechdrs[i].sh_addr      = TO_NATIVE(sechdrs[i].sh_addr);
> +		sechdrs[i].sh_offset    = TO_NATIVE(sechdrs[i].sh_offset);
> +		sechdrs[i].sh_size      = TO_NATIVE(sechdrs[i].sh_size);
> +		sechdrs[i].sh_link      = TO_NATIVE(sechdrs[i].sh_link);
> +		sechdrs[i].sh_info      = TO_NATIVE(sechdrs[i].sh_info);
> +		sechdrs[i].sh_addralign = TO_NATIVE(sechdrs[i].sh_addralign);
> +		sechdrs[i].sh_entsize   = TO_NATIVE(sechdrs[i].sh_entsize);
>  	}
>  	/* Find symbol table. */
>  	for (i = 1; i < hdr->e_shnum; i++) {

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

* Re: Lots of unexpected non-allocatable section warnings
  2009-05-04  8:28         ` Lots of unexpected non-allocatable section warnings Manuel Lauss
  2009-05-04  9:49           ` Sam Ravnborg
@ 2009-05-04 15:26           ` David Daney
  1 sibling, 0 replies; 5+ messages in thread
From: David Daney @ 2009-05-04 15:26 UTC (permalink / raw)
  To: Manuel Lauss; +Cc: Sam Ravnborg, Anders Kaseorg, LKML, Linux-MIPS

Manuel Lauss wrote:
> Hi Sam,
> 
> On Sun, May 03, 2009 at 10:29:39PM +0200, Sam Ravnborg wrote:
>> This is due to the SUSE specific section as you expected.
>> We ignore sections named ".comment" but not ".comment" sections
>> with something appended to the name.
> 
> 
> On a related note, I see tons of the following warnings cross-building for
> MIPS:
> 
> WARNING: init/mounts.o (.mdebug.abi32): unexpected non-allocatable section.
> Did you forget to use "ax"/"aw" in a .S file?                              
> Note that for example <linux/init.h> contains                              
> section definitions for use in .S files.                                   
> 
> WARNING: init/mounts.o (.pdr): unexpected non-allocatable section.
> Did you forget to use "ax"/"aw" in a .S file?                     
> Note that for example <linux/init.h> contains                     
> section definitions for use in .S files. 
> 
> 
> I added ".pdr" and ".mdebug*" to the whitelist;  the resulting kernels still
> work.  (gcc-4.3.3, binutils-2.19.1)
> 

I too think they are needed.  Are you going to prepare a patch?

David Daney

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

end of thread, other threads:[~2009-05-04 15:26 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20090503110517.6d09bca2@hyperion.delvare>
     [not found] ` <20090503103010.GA27978@uranus.ravnborg.org>
     [not found]   ` <20090503124848.276b437f@hyperion.delvare>
     [not found]     ` <20090503180332.GA31820@uranus.ravnborg.org>
     [not found]       ` <20090503202939.GA1237@uranus.ravnborg.org>
2009-05-04  8:28         ` Lots of unexpected non-allocatable section warnings Manuel Lauss
2009-05-04  9:49           ` Sam Ravnborg
2009-05-04 10:05             ` Manuel Lauss
2009-05-04 15:24             ` David Daney
2009-05-04 15:26           ` David Daney

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