linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* warning: allocated section `.data_nosave'  not in segment
@ 2009-09-25 20:54 Sean MacLennan
  2009-09-28  5:36 ` Sean MacLennan
  0 siblings, 1 reply; 6+ messages in thread
From: Sean MacLennan @ 2009-09-25 20:54 UTC (permalink / raw)
  To: linuxppc-dev

Anybody else getting these? They just started popping up with the
recent changes for 2.6.32. 

ppc_4xxFP-ld: .tmp_vmlinux1: warning: allocated section `.data_nosave'
 not in segment KSYM    .tmp_kallsyms1.S
  AS      .tmp_kallsyms1.o
  LD      .tmp_vmlinux2
ppc_4xxFP-ld: .tmp_vmlinux2: warning: allocated section `.data_nosave' not in segment
  KSYM    .tmp_kallsyms2.S
  AS      .tmp_kallsyms2.o
  LD      vmlinux
ppc_4xxFP-ld: vmlinux: warning: allocated section `.data_nosave' not in segment

Cheers,
   Sean

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

* Re: warning: allocated section `.data_nosave'  not in segment
  2009-09-25 20:54 warning: allocated section `.data_nosave' not in segment Sean MacLennan
@ 2009-09-28  5:36 ` Sean MacLennan
  2009-09-28 15:53   ` Sean MacLennan
  0 siblings, 1 reply; 6+ messages in thread
From: Sean MacLennan @ 2009-09-28  5:36 UTC (permalink / raw)
  To: linuxppc-dev

If I revert the commit show at the bottom of this email, the warnings
go away.

It took a while to find this, git bisect kept pointing me to a file
from arch/alpha :(

Cheers,
   Sean


powerpc: Cleanup linker script using new linker script macros.



author	Tim Abbott <tabbott@ksplice.com>

	 Thu, 24 Sep 2009 14:36:24 +0000 (10:36 -0400)

committer	Linus Torvalds <torvalds@linux-foundation.org>

	 Fri, 25 Sep 2009 00:16:22 +0000 (17:16 -0700)

commit	62bef288588bee976b753f7168716621d7a984e2

tree	8f55ea7fc2c5d651b72d1addad5687d61b857910	tree |
snapshot

parent	4a5e35135d1ffcf14ebb2bb3c730b92c18ae9657	commit |
diff



powerpc: Cleanup linker script using new linker script macros.



Signed-off-by: Tim Abbott <tabbott@ksplice.com>

Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>

Cc: Paul Mackerras <paulus@samba.org>

Cc: linuxppc-dev@ozlabs.org

Acked-by: Sam Ravnborg <sam@ravnborg.org>

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

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

* Re: warning: allocated section `.data_nosave'  not in segment
  2009-09-28  5:36 ` Sean MacLennan
@ 2009-09-28 15:53   ` Sean MacLennan
  2009-09-28 20:56     ` Segher Boessenkool
  0 siblings, 1 reply; 6+ messages in thread
From: Sean MacLennan @ 2009-09-28 15:53 UTC (permalink / raw)
  To: linuxppc-dev

I looked into it some more.... the patch converts this section:

        . = ALIGN(PAGE_SIZE);
        .data_nosave : AT(ADDR(.data_nosave) - LOAD_OFFSET) {
               __nosave_begin = .;
               *(.data.nosave)
               . = ALIGN(PAGE_SIZE);
               __nosave_end = .;
        }

to:

	.data_nosave : AT(ADDR(.data_nosave) - LOAD_OFFSET) {
		NOSAVE_DATA
	}

If you expand the NOSAVE_DATA macro, you get:

	.data_nosave : AT(ADDR(.data_nosave) - LOAD_OFFSET) {
		. = ALIGN(PAGE_SIZE);
		VMLINUX_SYMBOL(__nosave_begin) = .;
		*(.data.nosave)
		. = ALIGN(PAGE_SIZE);
		VMLINUX_SYMBOL(__nosave_end) = .;
	}

If you ignore the VMLINUX_SYMBOL, the only difference is moving the
ALIGN inside the brackets. If I move the ALIGN back where it was, then
the warning goes away.

But other sections moved the ALIGN without an issue. Could it be a
compiler problem? We are using  version 4.0.0 (DENX ELDK 4.1 4.0.0).

Cheers,
   Sean

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

* Re: warning: allocated section `.data_nosave'  not in segment
  2009-09-28 15:53   ` Sean MacLennan
@ 2009-09-28 20:56     ` Segher Boessenkool
  2009-09-28 23:24       ` Sean MacLennan
  0 siblings, 1 reply; 6+ messages in thread
From: Segher Boessenkool @ 2009-09-28 20:56 UTC (permalink / raw)
  To: Sean MacLennan; +Cc: linuxppc-dev

> If you ignore the VMLINUX_SYMBOL, the only difference is moving the
> ALIGN inside the brackets. If I move the ALIGN back where it was, then
> the warning goes away.
>
> But other sections moved the ALIGN without an issue. Could it be a
> compiler problem? We are using  version 4.0.0 (DENX ELDK 4.1 4.0.0).

The compiler version is probably not relevant; the binutils versions
might be though.  But, it seems to me the patch was simply botched,
the ALIGN() should not have moved.

Look at the output of "ld -M" (the ld command with all the args that
are used during the compile, with -M added) to see what's up; or maybe
readelf can tell you already.


Segher

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

* Re: warning: allocated section `.data_nosave'  not in segment
  2009-09-28 20:56     ` Segher Boessenkool
@ 2009-09-28 23:24       ` Sean MacLennan
  2009-09-29  0:29         ` Segher Boessenkool
  0 siblings, 1 reply; 6+ messages in thread
From: Sean MacLennan @ 2009-09-28 23:24 UTC (permalink / raw)
  To: Segher Boessenkool; +Cc: linuxppc-dev

Here is the ld -M output for the "bad" compile:

.data_nosave    0xc0376790      0x870 load address 0x00376790
                0xc0377000                . = ALIGN (0x1000)
 *fill*         0xc0376790      0x870 00
                0xc0377000                __nosave_begin = .
 *(.data.nosave)
                0xc0377000                . = ALIGN (0x1000)
                0xc0377000                __nosave_end = .
                0xc0377000                . = ALIGN (0x1000)
                0xc0377000                _edata = .
                0xc0377000                PROVIDE (edata, .)
                0xc0377000                . = ALIGN (0x0)
                0xc0377000                __bss_start = .
                0xc0377000                . = ALIGN (0x0)

.sbss           0xc0377000      0xad0 load address 0x00377000

Here is the ld -M output for a "good" compile (i.e. align before
the .data_nosave:

                0xc0377000                . = ALIGN (0x1000)

.data_nosave    0xc0377000        0x0 load address 0x00377000
                0xc0377000                __nosave_begin = .
 *(.data.nosave)
                0xc0377000                . = ALIGN (0x1000)
                0xc0377000                __nosave_end = .
                0xc0377000                . = ALIGN (0x1000)
                0xc0377000                _edata = .
                0xc0377000                PROVIDE (edata, .)
                0xc0377000                . = ALIGN (0x0)
                0xc0377000                __bss_start = .
                0xc0377000                . = ALIGN (0x0)

.sbss           0xc0377000      0xad0 load address 0x00377000

It looks like putting the align before the .data.nosave puts all the
labels at the same address. Putting it *after* allows the .data_nosave
to be in a different page than the labels.

I can provide more info if needed. But it looks like everything is
nicely aligned, until the data_nosave, which needs the alignment. The
section before it is one of the few with stuff in it.

Cheers,
   Sean 

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

* Re: warning: allocated section `.data_nosave'  not in segment
  2009-09-28 23:24       ` Sean MacLennan
@ 2009-09-29  0:29         ` Segher Boessenkool
  0 siblings, 0 replies; 6+ messages in thread
From: Segher Boessenkool @ 2009-09-29  0:29 UTC (permalink / raw)
  To: Sean MacLennan; +Cc: linuxppc-dev

> Here is the ld -M output for the "bad" compile:
>
> .data_nosave    0xc0376790      0x870 load address 0x00376790
>                 0xc0377000                . = ALIGN (0x1000)
>  *fill*         0xc0376790      0x870 00

Ah right.  Having the ALIGN() inside the output section causes the linker
to put some filler in there, which makes it a non-empty section, but this
section isn't assigned to a segment so you get a warning from the linker.

I think the proper way to do this is to not put the ALIGN() before the
output section, nor inside it, but _on_ it, like

.data_nosave : ALIGN(0x1000) { .... }


Segher

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

end of thread, other threads:[~2009-09-29  0:29 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-25 20:54 warning: allocated section `.data_nosave' not in segment Sean MacLennan
2009-09-28  5:36 ` Sean MacLennan
2009-09-28 15:53   ` Sean MacLennan
2009-09-28 20:56     ` Segher Boessenkool
2009-09-28 23:24       ` Sean MacLennan
2009-09-29  0:29         ` Segher Boessenkool

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).