Binutils 2.19.51 gold cygwin problems

Vladimir Simonov sv@sw.ru
Mon Apr 13 11:26:00 GMT 2009


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
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: binutils-2.19.51-gold-compile.patch
URL: <https://sourceware.org/pipermail/binutils/attachments/20090413/1d42b760/attachment.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: binutils-2.19.51-gold-cygwin.patch
URL: <https://sourceware.org/pipermail/binutils/attachments/20090413/1d42b760/attachment-0001.ksh>


More information about the Binutils mailing list