[Bug gold/12007] New: Illegal initialization vma_sections_(NULL)

2010-09-12 Thread nodakai at gmail dot com
The commit 7ee3aac210a9fbf16b2a26314bed5b15fce90b8d introduces wrong
initialization code to gold/script-sections.cc and this prevents
building the file with g++ -W -Wall -Werror .

std::vector doesn't have ctor which takes one pointer argument
(see http://www.cplusplus.com/reference/stl/vector/vector/ ).
Probably the original author intended to initialize vma_sections_ (whose
type is std::vector ) so that it was empty.
According to the STL reference, the default ctor of std::vector suffices
for that purpose.

== Patch ==
diff --git a/gold/script-sections.cc b/gold/script-sections.cc
index 1a19ad8..d5c6f2f 100644
--- a/gold/script-sections.cc
+++ b/gold/script-sections.cc
@@ -54,9 +54,7 @@ class Memory_region
   start_(start),
   length_(length),
   current_vma_offset_(0),
-  current_lma_offset_(0),
-  vma_sections_(NULL),
-  lma_sections_(NULL)
+  current_lma_offset_(0)
   { }

   // Return the name of this region.


== Obvervation of the bug ==
$ g++ -W -Werror -c script-sections.cc -o script-sections.o
cc1plus: warnings being treated as errors
script-sections.cc: In constructor 'gold::Memory_region::Memory_region(const
char*, size_t, unsigned int, gold::Expression*, gold::Expression*)':
script-sections.cc:59: warning: passing NULL to non-pointer argument 1 of
'std::vector<_Tp, _Alloc>::vector(size_t, const _Tp&, const _Alloc&) [with _Tp =
gold::Output_section_definition*, _Alloc =
std::allocator]'
script-sections.cc:59: warning: passing NULL to non-pointer argument 1 of
'std::vector<_Tp, _Alloc>::vector(size_t, const _Tp&, const _Alloc&) [with _Tp =
gold::Output_section_definition*, _Alloc =
std::allocator]'
make: *** [script-sections.o] Error 1
$ g++ --version
g++ (GCC) 4.1.2 20080704 (Red Hat 4.1.2-48)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ cat /etc/redhat-release
CentOS release 5.5 (Final)

-- 
   Summary: Illegal initialization vma_sections_(NULL)
   Product: binutils
   Version: 2.21 (HEAD)
Status: NEW
  Severity: normal
  Priority: P2
 Component: gold
AssignedTo: ian at airs dot com
ReportedBy: nodakai at gmail dot com
CC: bug-binutils at gnu dot org
 GCC build triplet: x86_64-unknown-linux-gnu
  GCC host triplet: x86_64-unknown-linux-gnu
GCC target triplet: x86_64-unknown-linux-gnu


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

--- 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/12007] Illegal initialization vma_sections_(NULL)

2010-09-12 Thread nodakai at gmail dot com

--- Additional Comments From nodakai at gmail dot com  2010-09-12 12:07 
---
Sorry, I misunderstood that binutils had already moved from CVS to GIT
and referred to the changeset from the GIT clone of the repo.
I meant this change:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gold/script-sections.cc.diff?r1=1.39&r2=1.40&cvsroot=src

-- 


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

--- 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/12010] New: gold fails to rebuild binutils

2010-09-12 Thread nwmcsween+sourceware at gmail dot com
Gold is installed but fails to rebuild binutils, specifically when rebuilding 
itself

x86_64-pc-linux-gnu-g++ -W -Wall -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -
frandom-seed=ld-new -mtune=generic -O2 -pipe -fno-ident -ggdb -g3 -feliminate-
unused-debug-types  -Wl,--compress-debug-sections=zlib,--hash-style=gnu,-O1,-
z,combreloc,-z,relro -o ld-new main.o i386.o x86_64.o sparc.o powerpc.o arm.o 
libgold.a ../libiberty/libi
berty.a  -lpthread -ldl -lz 
...
/usr/lib64/gcc/x86_64-pc-linux-gnu/4.5.1/../../../../x86_64-pc-linux-gnu/bin/ld:
 
error: unsupported symbol binding
/usr/lib64/gcc/x86_64-pc-linux-gnu/4.5.1/../../../../x86_64-pc-linux-gnu/bin/ld:
 
error: unsupported symbol binding

-- 
   Summary: gold fails to rebuild binutils
   Product: binutils
   Version: 2.20
Status: NEW
  Severity: normal
  Priority: P2
 Component: gold
AssignedTo: ian at airs dot com
ReportedBy: nwmcsween+sourceware at gmail dot com
CC: bug-binutils at gnu dot org


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

--- 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/12010] gold fails to rebuild binutils

2010-09-12 Thread ian at airs dot com

--- Additional Comments From ian at airs dot com  2010-09-13 04:18 ---
This is presumably complaining about STB_GNU_UNIQUE.  That is supported in 
current versions of gold, though it was not supported in the 2.20 release.

-- 
   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED


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

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