Re: binutils 2.19 issue with kernel link

2009-07-09 Thread Kumar Gala


On Jul 8, 2009, at 11:40 PM, Alan Modra wrote:


On Wed, Jul 08, 2009 at 10:52:59PM -0500, Kumar Gala wrote:
To further verify this if I switch the -me500 to -mspe and build  
things

seem to be ok.  This further points at some APU section related bug.


Like omitting .PPC.EMB.apuinfo from your kernel link script?  See the
ld info doc on orphan sections.


Ok, not terribly enlightening, but why would .PPC.EMB.apuinfo sections  
be different than something like .debug sections which we also dont  
list in the linker script.


- k


___
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/10380] New: cannot build binutils statically

2009-07-09 Thread booleandomain at gmail dot com
I'm trying to build binutils-2.19.1 statically. I tried with
../binutils-2.19.1/configure LDFLAGS="-static" && make but I get:

ldd binutils/ar
linux-vdso.so.1 =>  (0x7fffaf9ff000)
libz.so.1 => /lib/libz.so.1 (0x7fe1a223d000)
libc.so.6 => /lib/libc.so.6 (0x7fe1a1ee2000)
/lib64/ld-linux-x86-64.so.2 (0x7fe1a2453000)

This procedure works for all other packages I'm trying to compile (gcc, bash,
...) but it seems not to work for binutils. Why? Is there perhaps another way to
accomplish this? I also tried reading ./configure --help, README and
binutils/README but there is no useful information.

-- 
   Summary: cannot build binutils statically
   Product: binutils
   Version: 2.19
Status: NEW
  Severity: normal
  Priority: P2
 Component: binutils
AssignedTo: unassigned at sources dot redhat dot com
ReportedBy: booleandomain at gmail dot com
CC: bug-binutils at gnu dot org
 GCC build triplet: x86_64-pc-linux-gnu
  GCC host triplet: x86_64-pc-linux-gnu
GCC target triplet: x86_64-pc-linux-gnu


http://sourceware.org/bugzilla/show_bug.cgi?id=10380

--- You are receiving this mail because: ---
You are on the CC list for the bug, or are watching someone who is.


___
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/10376] configure: error: cannot compute sizeof (off_t), 77

2009-07-09 Thread booleandomain at gmail dot com

--- Additional Comments From booleandomain at gmail dot com  2009-07-09 
19:55 ---
It seems the problem is not related to CFLAGS containing
-Wl,--dynamic-linker,/tools/lib64/ld-linux-x86-64.so.2, but to the fact I
probably installed glibc in /tools in the wrong way. In fact, I configured in
with --prefix=/tools instead of installing it with install_root=/tools. I can't
see why, but it seems there is a difference between the two.

-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=10376

--- You are receiving this mail because: ---
You are on the CC list for the bug, or are watching someone who is.


___
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils


Re: binutils 2.19 issue with kernel link

2009-07-09 Thread Edmar Wienskoski-RA8797

Kumar Gala wrote:


On Jul 8, 2009, at 11:40 PM, Alan Modra wrote:


On Wed, Jul 08, 2009 at 10:52:59PM -0500, Kumar Gala wrote:

To further verify this if I switch the -me500 to -mspe and build things
seem to be ok.  This further points at some APU section related bug.


Like omitting .PPC.EMB.apuinfo from your kernel link script?  See the
ld info doc on orphan sections.


Ok, not terribly enlightening, but why would .PPC.EMB.apuinfo sections 
be different than something like .debug sections which we also dont 
list in the linker script.


- k


Alan,

I understand your arguments, but there is something inconsistent about this.
If I change the script to be:
   _end3 = . ;
   . = _end3;
   . = ALIGN(PAGE_SIZE);
   _end = . ;
   PROVIDE32 (end = .);
}
The result is corrected:
c067f678 A _end3
c068 A _end

Why the apuinfo section with zero VMA sometimes interfere with "." and 
sometimes not ?


Edmar



___
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils


Re: binutils 2.19 issue with kernel link

2009-07-09 Thread Alan Modra
On Thu, Jul 09, 2009 at 02:31:53PM -0500, Edmar Wienskoski-RA8797 wrote:
> Kumar Gala wrote:
>>
>> On Jul 8, 2009, at 11:40 PM, Alan Modra wrote:
>>
>>> On Wed, Jul 08, 2009 at 10:52:59PM -0500, Kumar Gala wrote:
 To further verify this if I switch the -me500 to -mspe and build things
 seem to be ok.  This further points at some APU section related bug.
>>>
>>> Like omitting .PPC.EMB.apuinfo from your kernel link script?  See the
>>> ld info doc on orphan sections.
>>
>> Ok, not terribly enlightening, but why would .PPC.EMB.apuinfo sections  
>> be different than something like .debug sections which we also dont  
>> list in the linker script.

Because .PPC.EMB.apuinfo is a note section rather than a debugging
section.  Orphan non-alloc note sections will be placed before
.comment or debug sections while orphan debug sections go right to the
end.  Now, I'll bet you don't have .comment in your script so it too
is an orphan.

> I understand your arguments, but there is something inconsistent about this.
> If I change the script to be:
>_end3 = . ;
>. = _end3;
>. = ALIGN(PAGE_SIZE);
>_end = . ;
>PROVIDE32 (end = .);
> }
> The result is corrected:
> c067f678 A _end3
> c068 A _end
>
> Why the apuinfo section with zero VMA sometimes interfere with "." and  
> sometimes not ?

That is weird.  You'll need to run ld under gdb to find out.  I'd
expect the orphan apuinfo section to be placed before the first
assignment to dot in both cases, or at the end of the script in both
cases, with placement depending on whether you hit an orphan .comment
or debug section before the orphan .PPC.EMB.apuinfo.


The underlying reason is that if you provide a link script that
doesn't mention a section, then ld is free to place that section
anywhere.  Quoting from the ld info doc:

"Orphan sections are sections present in the input files which are not
explicitly placed into the output file by the linker script.  The
linker will still copy these sections into the output file, but it has
to guess as to where they should be placed.  The linker uses a simple
heuristic to do this.  It attempts to place orphan sections after
non-orphan sections of the same attribute, such as code vs data,
loadable vs non-loadable, etc.  If there is not enough room to do this
then it places at the end of the file.

For ELF targets, the attribute of the section includes section type as
well as section flag."


That's all as expected, and in your case you don't have a section with
the same attribute as .PPC.EMB.apuinfo so it should go to the end.
However, you have multiple orphan sections being added.  After the
first of these is added, you have sections after your end symbol
assignments, and when there are assignments it gets tricky.  The
relevant part of the ld info doc says:


"Setting symbols to the value of the location counter outside of an
output section statement can result in unexpected values if the linker
needs to place orphan sections.  For example, given the following:

SECTIONS
{
start_of_text = . ;
.text: { *(.text) }
end_of_text = . ;

start_of_data = . ;
.data: { *(.data) }
end_of_data = . ;
}

If the linker needs to place some input section, e.g. .rodata, not
mentioned in the script, it might choose to place that section between
.text and .data.  You might think the linker should place .rodata on
the blank line in the above script, but blank lines are of no
particular significance to the linker.  As well, the linker doesn't
associate the above symbol names with their sections.  Instead, it
assumes that all assignments or other statements belong to the
previous output section, except for the special case of an assignment
to '.'.  I.e., the linker will place the orphan .rodata section as if
the script was written as follows:

SECTIONS
{
start_of_text = . ;
.text: { *(.text) }
end_of_text = . ;

start_of_data = . ;
.rodata: { *(.rodata) }
.data: { *(.data) }
end_of_data = . ;
}

This may or may not be the script author's intention for the value of
start_of_data.  One way to influence the orphan section placement is
to assign the location counter to itself, as the linker assumes that
an assignment to '.' is setting the start address of a following
output section and thus should be grouped with that section.  So you
could write:

SECTIONS
{
start_of_text = . ;
.text: { *(.text) }
end_of_text = . ;

. = . ;
start_of_data = . ;
.data: { *(.data) }
end_of_data = . ;
}

Now, the orphan .rodata section will be placed between end_of_text and
start_of_data."


Putting this all together:
a) ld places .comment or some debug section at end
b) ld places .PPC.EMB.apuinfo before the other orphan section, and
thinks your assignments to dot belong with the other orphan, so 
.PPC.EMB.apuinfo goes before them.

As no doubt you've already found, you can fix your link script by not
using ". = ALIGN(PAGE_SIZE)"; instead use "sym = ALIG

Re: binutils 2.19 issue with kernel link

2009-07-09 Thread Alan Modra
On Thu, Jul 09, 2009 at 02:31:53PM -0500, Edmar Wienskoski-RA8797 wrote:
> I understand your arguments, but there is something inconsistent about this.
> If I change the script to be:
>_end3 = . ;
>. = _end3;
>. = ALIGN(PAGE_SIZE);
>_end = . ;
>PROVIDE32 (end = .);
> }
> The result is corrected:
> c067f678 A _end3
> c068 A _end
>
> Why the apuinfo section with zero VMA sometimes interfere with "." and  
> sometimes not ?

I said it was weird in my last email.  Not so.  The orphan gets placed
between

   _end3 = . ;
   . = _end3;

So dot is restored after the orphan section sets it.

-- 
Alan Modra
Australia Development Lab, IBM


___
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils