This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Binutils 2.19.51 gold cygwin problems


Hello Ian,

Playing with binutils 2.19.51 and gold last weekend I've
met several problems and hope they will be interesting
for you.
So, the list:

1. Gold can't be compiled with Werror turned on.
Attaching binutils-2.19.51-gold-compile.patch.

2. Pagesize on cygwin is 64K so mmap doesn't work
with default 8K granularity (fileread.h).
I've just increased the default up to 64K - see
binutils-2.19.51-gold-cygwin.patch.
I don't think this change will affect other platforms
performance/resources consuming. If do, then the value
should be detected during configure step.

But I'm not sure that the rest of code doesn't have
internal assumptions about 8K value.

3. On link real quite big program with large debug info
(~200Mb) something wrong happens in object.cc - assert in
line 1876.
/* object.cc */
template<int size, bool big_endian>
typename Sized_relobj<size, big_endian>::Address
Sized_relobj<size, big_endian>::map_to_kept_section(
    unsigned int shndx,
    bool* found) const
{
  Kept_comdat_section *kept = this->get_kept_comdat_section(shndx);
  if (kept != NULL)
    {
      gold_assert(kept->object_ != NULL);
      *found = true;
      Output_section* os = kept->object_->output_section(kept->shndx_);
      Address offset = kept->object_->get_output_section_offset(kept->shndx_);
/*line 1876*/
      gold_assert(os != NULL && offset != invalid_address);
      return os->address() + offset;
    }

The test was not clean - all shared libraries were built by
"old ld". Do you think it is a reason of problem?

All below is compatibility with "old ld" problems:
4. Symbol-vers file parser doesn't support DOS CR/LF:
ld: error: symbols.vers:1:10: invalid character
ld: error: symbols.vers:1:10: syntax error, unexpected $end, \
expecting STRING or QUOTED_STRING or EXTERN

ld: fatal error: unable to parse version script file symbols.vers
Of course, it is not too big problem but "old ld"
works ok with it.

5. --verbose option in "old ld" provides output with internal
script. Something like:
GNU ld (GNU Binutils) 2.18
  Supported emulations:
   elf_i386
   i386linux
using internal linker script:
==================================================
/* Script for --shared -z combreloc: shared library, combine & sort relocs */
OUTPUT_FORMAT("elf32-i386", "elf32-i386",
              "elf32-i386")
........

gold just report:
ld: fatal error: no input files

Full command line:
/opt/crosstool/i686-unknown-linux-gnu/gcc-4.3.3-glibc-2.9/libexec/gcc/i686-unknown-linux-gnu/4.3.3/collect2.exe --sysroot=/opt/crosstool/i686-unknown-linux-gnu/gcc-4.3.3-glibc-2.9/i686-unknown-linux-gnu/sys-root --eh-frame-hdr -m elf_i386 -shared -L/opt/crosstool/i686-unknown-linux-gnu/gcc-4.3.3-glibc-2.9/lib/gcc/i686-unknown-linux-gnu/4.3.3 -L/opt/crosstool/i686-unknown-linux-gnu/gcc-4.3.3-glibc-2.9/lib/gcc/i686-unknown-linux-gnu/4.3.3/../../../../i686-unknown-linux-gnu/lib -L/opt/crosstool/i686-unknown-linux-gnu/gcc-4.3.3-glibc-2.9/i686-unknown-linux-gnu/sys-root/lib -L/opt/crosstool/i686-unknown-linux-gnu/gcc-4.3.3-glibc-2.9/i686-unknown-linux-gnu/sys-root/usr/lib --debug all -z combreloc -z relro --hash-style=both -z defs --verbose


As result I was not able to build glibc 2.9 in cross-environment.
Do you think gold should provide such kind of
compatibility or it should be glibc issue?
IMO glibc build should be one of gold <-> ld <-> glibc
compatibility criteria.


Best regards Vladimir Simonov
--- binutils-2.19.51/gold/dynobj.cc.orig	2009-02-13 22:04:44.000000000 +0300
+++ binutils-2.19.51/gold/dynobj.cc	2009-04-11 18:28:11.234375000 +0400
@@ -167,7 +167,7 @@
 
       if (*pi != -1U)
 	this->error(_("unexpected duplicate type %u section: %u, %u"),
-		    shdr.get_sh_type(), *pi, i);
+		    static_cast<unsigned int>(shdr.get_sh_type()), *pi, i);
 
       *pi = i;
     }
--- binutils-2.19.51/gold/object.cc.orig	2009-03-24 21:42:10.000000000 +0300
+++ binutils-2.19.51/gold/object.cc	2009-04-11 18:27:38.343750000 +0400
@@ -645,7 +645,7 @@
   if (sym.get_st_name() >= symnamelen)
     {
       this->error(_("symbol %u name offset %u out of range"),
-		  symndx, sym.get_st_name());
+		  symndx, static_cast<unsigned int>(sym.get_st_name()));
       return false;
     }
 
@@ -712,7 +712,7 @@
       if (secnum >= this->shnum())
 	{
 	  this->error(_("section %u in section group %u out of range"),
-		      secnum, index);
+		      static_cast<unsigned int>(secnum), index);
 	  continue;
 	}
 
@@ -720,7 +720,7 @@
       // it wrong--we may have already decided to include the section.
       if (secnum < index)
         this->error(_("invalid section group %u refers to earlier section %u"),
-                    index, secnum);
+                    index, static_cast<unsigned int>(secnum));
 
       // Get the name of the member section.
       typename This::Shdr member_shdr(shdrs + secnum * This::shdr_size);
@@ -1470,7 +1470,7 @@
       if (sym.get_st_name() >= strtab_size)
 	{
 	  this->error(_("local symbol %u section name out of range: %u >= %u"),
-		      i, sym.get_st_name(),
+		      i, static_cast<unsigned int>(sym.get_st_name()),
 		      static_cast<unsigned int>(strtab_size));
 	  lv.set_no_output_symtab_entry();
 	  continue;
--- binutils-2.19.51/gold/fileread.h.orig	2009-03-14 08:56:46.000000000 +0300
+++ binutils-2.19.51/gold/fileread.h	2009-04-12 00:36:06.765625000 +0400
@@ -335,7 +335,7 @@
   clear_views(bool);
 
   // The size of a file page for buffering data.
-  static const off_t page_size = 8192;
+  static const off_t page_size = 65536;
 
   // Given a file offset, return the page offset.
   static off_t

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]