[Bug gold/7088] New: Script parse error on INPUT ( )

2008-12-09 Thread stefan dot becker at nokia dot com
I tried to use gold instead of the standard GNU ld in our SW build system. I
stumbled over the fact that gold gives me a script parse error for a ".a" script
file containing INPUT().

Here is a stripped down example to reproduce the problem:

$ cat hello.c
#include 

int main(int argc, char **argv)
{
  printf("Hello, world!\n");
}
$ gcc -o hello.o -c hello.c
$ ld -r -o hello.a hello.o

$ (echo 'INPUT('; echo hello.a; echo ')') >final.a
$ cat final.a
INPUT (
hello.a
)

GNU ld:

$ ld -o final final.a
ld: warning: cannot find entry symbol _start; defaulting to 08048074
hello.a: In function `main':
(.text+0x24): undefined reference to `puts'

Gold:

$ build/gold/ld-new -o final final.a
build/gold/ld-new: final.a:1:1: syntax error, unexpected INPUT, expecting $end
build/gold/ld-new: final.a: not an object or archive
$ build/gold/ld-new -o final --script final.a
build/gold/ld-new: final.a:1:1: syntax error, unexpected INPUT, expecting $end
build/gold/ld-new: unable to parse script file final.a


I know that I could replace this example with a @-file but we use at least one
commercial tool that feeds the linker with an input file that contains INPUT().

-- 
   Summary: Script parse error on INPUT ( )
   Product: binutils
   Version: 2.19
Status: NEW
  Severity: normal
  Priority: P2
 Component: gold
    AssignedTo: ian at airs dot com
    ReportedBy: stefan dot becker at nokia dot com
CC: bug-binutils at gnu dot org
  GCC host triplet: i386-redhat-linux-gnu


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

--- 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 gold/7088] Script parse error on INPUT ( )

2008-12-10 Thread stefan dot becker at nokia dot com

--- Additional Comments From stefan dot becker at nokia dot com  2008-12-10 
08:09 ---
Thanks for the quick turnaround time. The problem is gone.

-- 


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

--- 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 gold/7091] New: Internal error on object generated by gnuld

2008-12-10 Thread stefan dot becker at nokia dot com
348 in gold::Sized_relobj<32, false>::relocate_sections (
this=0xa1b4ab0, [EMAIL PROTECTED], symtab=0xbfac5ca0, layout=0xbfac5b14,
pshdrs=0xb8080f80 "", pviews=0xbfac4330)
at ../../binutils-2.19/gold/reloc.cc:803
#3  0x08125e67 in gold::Sized_relobj<32, false>::do_relocate (this=0xa1b4ab0,
[EMAIL PROTECTED], symtab=0xbfac5ca0, layout=0xbfac5b14, of=0xa52e6f0)
at ../../binutils-2.19/gold/reloc.cc:486
#4  0x0811d421 in gold::Relocate_task::run (this=0xa52e7d8)
at ../../binutils-2.19/gold/object.h:628
#5  0x0815b8e7 in gold::Workqueue::find_and_run_task (this=0xbfac5e80,
thread_number=0) at ../../binutils-2.19/gold/workqueue.cc:314
#6  0x0815bb8c in gold::Workqueue::process (this=0xbfac5e80, thread_number=0)
at ../../binutils-2.19/gold/workqueue.cc:480
#7  0x0804ac04 in main (argc=-1079227524, argv=0x1)
at ../../binutils-2.19/gold/main.cc:219


As I'm not allowed to distribute the precompiled library I hope you can tell me
what additional information I would need to collect for your error analysis.

-- 
   Summary: Internal error on object generated by gnuld
   Product: binutils
   Version: 2.19
Status: NEW
  Severity: normal
  Priority: P2
     Component: gold
    AssignedTo: ian at airs dot com
ReportedBy: stefan dot becker at nokia dot com
CC: bug-binutils at gnu dot org
  GCC host triplet: i386-redhat-linux-gnu


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

--- 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 gold/7091] Internal error on object generated by gnuld

2008-12-11 Thread stefan dot becker at nokia dot com

--- Additional Comments From stefan dot becker at nokia dot com  2008-12-11 
09:37 ---
Dooh, no wonder I couldn't make heads or tails out of the backtrace. Should have
thought about that myself :-)

Here is the backtrace generated from a binary compiled with -O0:

(gdb) bt
#0  gold::do_gold_unreachable ( 
filename=0x81f1d50 "../../binutils-2.19/gold/object.h", lineno=968, 
function=0x81f263d "output_symtab_index")   
at ../../binutils-2.19/gold/gold.cc:84  
#1  0x080619d1 in gold::Symbol_value<32>::output_symtab_index (this=0x8a471e0)
at ../../binutils-2.19/gold/object.h:968  
#2  0x08061a2f in gold::Sized_relobj<32, false>::symtab_index (this=0x8a28ab0, 
sym=0) at ../../binutils-2.19/gold/object.h:1239   
#3  0x08064a4c in gold::relocate_for_relocatable<32, false, 9> (   
relinfo=0xbff09670, prelocs=0xb7e45128 "h\v", reloc_count=4329,
output_section=0x8c340a0, offset_in_output_section=0, rr=0x8c987f0,
view=0xb7d1aff8 "\030", view_address=0, reloc_view=0xb7d78a64 "\022",  
reloc_view_size=34632) at ../../binutils-2.19/gold/target-reloc.h:479  
#4  0x0805a761 in relocate_for_relocatable (this=0x8a28be0,
relinfo=0xbff09670, sh_type=9, prelocs=0xb7e44e00 "\022",  
reloc_count=4329, output_section=0x8c340a0, offset_in_output_section=0,
rr=0x8c987f0, view=0xb7d1aff8 "\030", view_address=0, view_size=116096,
reloc_view=0xb7d78a64 "\022", reloc_view_size=34632)   
at ../../binutils-2.19/gold/i386.cc:2516   
#5  0x08142138 in gold::Sized_relobj<32, false>::relocate_sections (   
this=0x8a28ab0, [EMAIL PROTECTED], symtab=0xbff0b0f0, layout=0xbff0af64, 
pshdrs=0xb7ec5f80 "", pviews=0xbff09718)   
at ../../binutils-2.19/gold/reloc.cc:803   
#6  0x081428d2 in gold::Sized_relobj<32, false>::do_relocate (this=0x8a28ab0,  
[EMAIL PROTECTED], symtab=0xbff0b0f0, layout=0xbff0af64, of=0x8da26f0)   
at ../../binutils-2.19/gold/reloc.cc:486   
#7  0x08136046 in gold::Relobj::relocate (this=0x8a28ab0, [EMAIL PROTECTED], 
symtab=0xbff0b0f0, layout=0xbff0af64, of=0x8da26f0)
at ../../binutils-2.19/gold/object.h:628   
#8  0x08135cee in gold::Relocate_task::run (this=0x8da27d8)
at ../../binutils-2.19/gold/reloc.cc:164   
#9  0x0818f225 in gold::Workqueue::find_and_run_task (this=0xbff0b2d0, 
thread_number=0) at ../../binutils-2.19/gold/workqueue.cc:314  
#10 0x0818f39e in gold::Workqueue::process (this=0xbff0b2d0, thread_number=0)  
at ../../binutils-2.19/gold/workqueue.cc:480   
#11 0x0804b230 in main (argc=5, argv=0xbff0b3d4)   
at ../../binutils-2.19/gold/main.cc:219



(gdb) up   
#1  0x080619d1 in gold::Symbol_value<32>::output_symtab_index (this=0x8a471e0) 
at ../../binutils-2.19/gold/object.h:968   
968 gold_assert(this->output_symtab_index_ != 0);  
(gdb) l
963
964   // Return the index in the output symbol table.  
965   unsigned int 
966   output_symtab_index() const  
967   {
968 gold_assert(this->output_symtab_index_ != 0);  
969 return this->output_symtab_index_; 
970   }
971
972   // Set the index in the output symbol table. 
(gdb) print this
$1 = (const gold::Symbol_value<32> * const) 0x8a471e0


(gdb) up
#2  0x08061a2f in gold::Sized_relobj<32, false>::symtab_index (this=0x8a28ab0,
sym=0) at ../../binutils-2.19/gold/object.h:1239
1239return this->local_values_[sym].output_symtab_index();
(gdb) l
1234  // table.  A value of -1U means that the symbol is not being output.
1235  unsigned int
1236  symtab_index(unsigned in

[Bug gold/7091] Internal error on object generated by gnuld

2008-12-11 Thread stefan dot becker at nokia dot com

--- Additional Comments From stefan dot becker at nokia dot com  2008-12-11 
17:50 ---
Created an attachment (id=3100)
 --> (http://sourceware.org/bugzilla/attachment.cgi?id=3100&action=view)
Obfuscated output from readelf -Wr

Here is the requested data. I hope it doesn't matter that I obfuscated the
symbol names.

-- 


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

--- 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 gold/7091] Internal error on object generated by gnuld

2008-12-12 Thread stefan dot becker at nokia dot com

--- Additional Comments From stefan dot becker at nokia dot com  2008-12-12 
10:07 ---
Created an attachment (id=3103)
 --> (http://sourceware.org/bugzilla/attachment.cgi?id=3103&action=view)
Obfuscated output from readelf -Wr (production library)

Thanks for the fix. While the simple test case (source code compiled by me and
linked with GNU ld) works OK now, it still barfs on the precompiled from our SW
release. The error is now at a different location:

build/gold/ld-new: internal error in starting_output_address, at
../../binutils-2.19/gold/output.cc:2083

(gdb) bt  
#0  gold::do_gold_unreachable (   
filename=0x82014d4 "../../binutils-2.19/gold/output.cc", lineno=2083, 
function=0x82023b1 "starting_output_address") 
at ../../binutils-2.19/gold/gold.cc:84
#1  0x080fcf80 in gold::Output_section::starting_output_address ( 
this=0x9f54f88, object=0x9d31bd0, shndx=1960) 
at ../../binutils-2.19/gold/output.cc:2083
#2  0x080dee3a in gold::Sized_relobj<32, false>::do_finalize_local_symbols (
this=0x9d31bd0, index=607, off=1687796)
at ../../binutils-2.19/gold/object.cc:1284
#3  0x080b68d3 in gold::Relobj::finalize_local_symbols (this=0x9d31bd0,
index=607, off=1687796) at ../../binutils-2.19/gold/object.h:612
#4  0x080b30d9 in gold::Layout::create_symtab_sections (this=0xbfa59b64,
input_objects=0xbfa59e38, symtab=0xbfa59cf0, shnum=4940, poff=0xbfa58310)
at ../../binutils-2.19/gold/layout.cc:2112
#5  0x080b5830 in gold::Layout::finalize (this=0xbfa59b64,
input_objects=0xbfa59e38, symtab=0xbfa59cf0, target=0x9d31d00,
task=0x9d31ef8) at ../../binutils-2.19/gold/layout.cc:1278
#6  0x080b63fd in gold::Layout_task_runner::run (this=0x9d31ed8,
workqueue=0xbfa59ed0, task=0x9d31ef8)
at ../../binutils-2.19/gold/layout.cc:65
#7  0x080acf51 in gold::Task_function::run (this=0x9d31ef8,
workqueue=0xbfa59ed0) at ../../binutils-2.19/gold/workqueue.h:178
#8  0x0818f401 in gold::Workqueue::find_and_run_task (this=0xbfa59ed0,
thread_number=0) at ../../binutils-2.19/gold/workqueue.cc:314
#9  0x0818f57a in gold::Workqueue::process (this=0xbfa59ed0, thread_number=0)
at ../../binutils-2.19/gold/workqueue.cc:480
#10 0x0804b230 in main (argc=5, argv=0xbfa59fd4)
at ../../binutils-2.19/gold/main.cc:219


(gdb) up
#1  0x080fcf80 in gold::Output_section::starting_output_address (
this=0x9f54f88, object=0x9d31bd0, shndx=1960)
at ../../binutils-2.19/gold/output.cc:2083
2083  gold_unreachable();
(gdb) l
2078  if (p->is_merge_section_for(object, shndx))
2079return addr;
2080
2081  addr += p->data_size();
2082}
2083  gold_unreachable();
2084}
2085
2086// Set the data size of an Output_section.  This is where we handle
2087// setting the addresses of any Output_section_data objects.


(gdb) up
#2  0x080dee3a in gold::Sized_relobj<32, false>::do_finalize_local_symbols (
this=0x9d31bd0, index=607, off=1687796)
at ../../binutils-2.19/gold/object.cc:1284
1284os->starting_output_address(this, shndx);
(gdb) l
1279lv.set_output_value(os->output_address(this, shndx,
1280  
lv.input_value()));
1281  else
1282{
1283  section_offset_type start =
1284os->starting_output_address(this, shndx);
1285  Merged_symbol_value* msv =
1286new Merged_symbol_value(lv.input_value(),
start);
1287  lv.set_merged_symbol_value(msv);
1288}


(gdb) up
#3  0x080b68d3 in gold::Relobj::finalize_local_symbols (this=0x9d31bd0,
index=607, off=1687796) at ../../binutils-2.19/gold/object.h:612
612   { return this->do_finalize_local_symbols(index, off); }
(gdb) l
607   // Set the values of the local symbols, set the output symbol table
608   // indexes for the local variables, and set the offset where local
609   // symbol information will be stored. Returns the new local symbol
index.
610   unsigned int
611   finalize_local_symbols(unsigned int index, off_t off)
612   { return this->do_finalize_local_symbols(index, off); }
613
614   // Set the output dynamic symbol table indexes for the local
variables.
615   unsigned int
616   set_local_dynsym_indexes(unsigned int index)


I already see one difference: my library has .text sections whereas the
production library has .gnu.linkonce.t sections. If I remember correctly this
means that the production library has been compiled with GCC3. If you don't
think gold should be able to handle then I

[Bug gold/7091] Internal error on object generated by gnuld

2008-12-12 Thread stefan dot becker at nokia dot com

--- Additional Comments From stefan dot becker at nokia dot com  2008-12-12 
18:31 ---
Created an attachment (id=3104)
 --> (http://sourceware.org/bugzilla/attachment.cgi?id=3104&action=view)
Obfuscated output from readelf -WS --full-section-name (production library)

Attached is the requested output.

Section 1960:

  [1960] .rel.text
   REL  19f9d8 0342d8 08  4941 1959  4
   []:

I guess that is the main code section?

-- 


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

--- 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 gold/7091] Internal error on object generated by gnuld

2008-12-13 Thread stefan dot becker at nokia dot com

--- Additional Comments From stefan dot becker at nokia dot com  2008-12-13 
15:39 ---
So our only option is to make sure that the pre-compiled library is recompiled
and relinked with a newer gnuld linker or gold?

-- 


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

--- 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 gold/7091] Internal error on object generated by gnuld

2009-03-02 Thread stefan dot becker at nokia dot com

--- Additional Comments From stefan dot becker at nokia dot com  2009-03-02 
13:45 ---
Unfortunately the fix didn't help with the original file. I still get the same
assert message.

-- 


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

--- 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 gold/7091] Internal error on object generated by gnuld

2009-03-03 Thread stefan dot becker at nokia dot com

--- Additional Comments From stefan dot becker at nokia dot com  2009-03-03 
08:00 ---
Yes, I know. The problem should go away once we deploy a GCC version that uses
gold as linker and recompile the problematic library.

-- 


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

--- 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 gold/10098] New: gold 2.19.1: internal error in map_to_kept_section, at object.cc:1587

2009-04-23 Thread stefan dot becker at nokia dot com
gold aborts while linking a large C++ program with debug info. If the same
program is compiled without debug info the final link goes through OK.

I'm not sure if this is important: a small part of the code is
pre-compiled/pre-linked with another version of GCC that doesn't use gold.

My problem sounds similar to the following post on the binutils mailing list:

 <http://sourceware.org/ml/binutils/2009-04/msg00166.html>


Here is the gdb backtrace (binutils compiled with -O0):

(gdb) cont  
Continuing. 

Breakpoint 1, gold::Sized_relobj<32, false>::map_to_kept_section (
this=0xaba71d0, shndx=69, found=0xbffe1bc3)   
at ../../binutils-2.19.1/gold/object.cc:1587  
1587  gold_assert(os != NULL && offset != -1U);   
$3 = (class gold::Output_section *) 0x0   
$4 = 4294967295   

(gdb) l
1582{
1583  gold_assert(kept->object_ != NULL);
1584  *found = true;
1585  Output_section* os = kept->object_->output_section(kept->shndx_);
1586  Address offset =
kept->object_->get_output_section_offset(kept->shndx_);
1587  gold_assert(os != NULL && offset != -1U);
1588  return os->address() + offset;
1589}
1590  *found = false;
1591  return 0;


(gdb) bt  
#0  gold::Sized_relobj<32, false>::map_to_kept_section (this=0xaba71d0, 
shndx=69, found=0xbffe1bc3) at ../../binutils-2.19.1/gold/object.cc:1587
#1  0x0805db9d in relocate_section<32, false, ::Target_i386, 9,
::Target_i386::Relocate> (relinfo=0xbffe1cb0, target=0x96bcc10,   
   
prelocs=0xb8083310 "vk\002", reloc_count=3238, output_section=0x9753390,
needs_special_offset_handling=false, view=0xb085de1b "�\v",  
   
view_address=107322265, view_size=259282)   
at ../../binutils-2.19.1/gold/target-reloc.h:237
#2  0x0805df58 in relocate_section (this=0x96bcc10, relinfo=0xbffe1cb0, 
sh_type=9, prelocs=0xb807fb70 "\006", reloc_count=3238, 
output_section=0x9753390, needs_special_offset_handling=false,  
view=0xb085de1b "�\v", address=107322265, view_size=259282)  
   
at ../../binutils-2.19.1/gold/i386.cc:2374  
#3  0x08142309 in gold::Sized_relobj<32, false>::relocate_sections (
this=0xaba71d0, optio...@0xbffe1eb0, symtab=0xbffe3730, layout=0xbffe35a4,  
pshdrs=0xb6bc2c84 "", pviews=0xbffe1d58)
at ../../binutils-2.19.1/gold/reloc.cc:782  
#4  0x08142c6a in gold::Sized_relobj<32, false>::do_relocate (this=0xaba71d0,   
optio...@0xbffe1eb0, symtab=0xbffe3730, layout=0xbffe35a4, of=0xbff50c0)
at ../../binutils-2.19.1/gold/reloc.cc:486  
#5  0x081363de in gold::Relobj::relocate (this=0xaba71d0, optio...@0xbffe1eb0,
symtab=0xbffe3730, layout=0xbffe35a4, of=0xbff50c0)
at ../../binutils-2.19.1/gold/object.h:628
#6  0x08136086 in gold::Relocate_task::run (this=0xc007af0)
---Type  to continue, or q  to quit---
at ../../binutils-2.19.1/gold/reloc.cc:164
#7  0x0818f5bd in gold::Workqueue::find_and_run_task (this=0xbffe3910,
thread_number=0) at ../../binutils-2.19.1/gold/workqueue.cc:314
#8  0x0818f736 in gold::Workqueue::process (this=0xbffe3910, thread_number=0)
at ../../binutils-2.19.1/gold/workqueue.cc:480
#9  0x0804b340 in main (argc=37, argv=0xbffe3a14)
at ../../binutils-2.19.1/gold/main.cc:219

-- 
   Summary: gold 2.19.1: internal error in map_to_kept_section, at
object.cc:1587
   Product: binutils
   Version: 2.19
Status: NEW
      Severity: normal
      Priority: P2
 Component: gold
AssignedTo: ian at airs dot com
ReportedBy: stefan dot becker at nokia dot com
CC: bug-binutils at gnu dot org
  GCC host triplet: i686-pc-linux-gnu


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

--- 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 gold/10098] gold 2.19.1: internal error in map_to_kept_section, at object.cc:1587

2009-04-27 Thread stefan dot becker at nokia dot com

--- Additional Comments From stefan dot becker at nokia dot com  2009-04-27 
12:26 ---
You were correct. The problem is gone with the 20090427 snapshot.

-- 
   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||WORKSFORME


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

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