Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 93674 - [binutils/test] binutils fails tests on x86/x86_64 (objcopy)
Summary: [binutils/test] binutils fails tests on x86/x86_64 (objcopy)
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: The Gentoo Linux Hardened Team
URL: http://sourceware.org/bugzilla/show_b...
Whiteboard:
Keywords:
: 149151 159558 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-05-23 05:08 UTC by ingo
Modified: 2010-03-08 17:52 UTC (History)
10 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Log of binutils test phase (binutils.log,524.77 KB, text/plain)
2005-12-04 01:58 UTC, Kevin F. Quinn (RETIRED)
Details
Config logs (binutils-configlogs.tgz,51.35 KB, application/octet-stream)
2006-03-28 06:14 UTC, Paul Dunbar
Details
Log of ld test phase. (ld.log,264.64 KB, text/plain)
2006-06-04 03:55 UTC, Benno Schulenberg
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ingo 2005-05-23 05:08:07 UTC
When I compile bunutils with FEATURES="test" set, the compilation aborts in the
test phase. The three tests that fail are:
   FAIL: run objcopy of executable
   FAIL: run stripped executable
   FAIL: run stripped executable with saving a symbol
  
Additional output from make check:

....
make[3]: Entering directory
`/var/tmp/portage/binutils-2.15.92.0.2-r7/work/build/binutils'
Making a new site.exp file...
srcdir=`cd
/var/tmp/portage/binutils-2.15.92.0.2-r7/work/binutils-2.15.92.0.2/binutils &&
pwd`; export srcdir; \
r=`pwd`; export r; \
EXPECT=expect; export EXPECT; \
if [ -f ./../expect/expect ]; then \
  TCL_LIBRARY=`cd
/var/tmp/portage/binutils-2.15.92.0.2-r7/work/binutils-2.15.92.0.2/binutils/../tcl/library
&& pwd`; \
  export TCL_LIBRARY; \
fi; \
runtest=runtest; \
if /bin/sh -c "$runtest --version" > /dev/null 2>&1; then \
  CC_FOR_TARGET="gcc -L/var/tmp/portage/binutils-2.15.92.0.2-r7/work/build/ld"
CFLAGS_FOR_TARGET="-O2 -march=i686" \
        $runtest --tool binutils --srcdir ${srcdir}/testsuite \
                ; \
else echo "WARNING: could not find \`runtest'" 1>&2; :;\
fi
WARNING: Couldn't find the global config file.
WARNING: Couldn't find tool init file
Test Run By root on Mon May 23 13:33:01 2005
Native configuration is i686-pc-linux-gnu

                === binutils tests ===

Schedule of variations:
    unix

Running target unix
Using /usr/share/dejagnu/baseboards/unix.exp as board description file for target.
Using /usr/share/dejagnu/config/unix.exp as generic interface file for target.
Using
/var/tmp/portage/binutils-2.15.92.0.2-r7/work/binutils-2.15.92.0.2/binutils/testsuite/config/default.exp
as tool-and-target-specific interface file.
Running
/var/tmp/portage/binutils-2.15.92.0.2-r7/work/binutils-2.15.92.0.2/binutils/testsuite/binutils-all/ar.exp
...
Running
/var/tmp/portage/binutils-2.15.92.0.2-r7/work/binutils-2.15.92.0.2/binutils/testsuite/binutils-all/dlltool.exp
...
Running
/var/tmp/portage/binutils-2.15.92.0.2-r7/work/binutils-2.15.92.0.2/binutils/testsuite/binutils-all/hppa/objdump.exp
...
Running
/var/tmp/portage/binutils-2.15.92.0.2-r7/work/binutils-2.15.92.0.2/binutils/testsuite/binutils-all/m68k/objdump.exp
...
Running
/var/tmp/portage/binutils-2.15.92.0.2-r7/work/binutils-2.15.92.0.2/binutils/testsuite/binutils-all/nm.exp
...
Version /var/tmp/portage/binutils-2.15.92.0.2-r7/work/build/binutils/nm-new 20040927
Running
/var/tmp/portage/binutils-2.15.92.0.2-r7/work/binutils-2.15.92.0.2/binutils/testsuite/binutils-all/objcopy.exp
...
Version /var/tmp/portage/binutils-2.15.92.0.2-r7/work/build/binutils/objcopy
20040927
FAIL: run objcopy of executable
FAIL: run stripped executable
FAIL: run stripped executable with saving a symbol
Running
/var/tmp/portage/binutils-2.15.92.0.2-r7/work/binutils-2.15.92.0.2/binutils/testsuite/binutils-all/objdump.exp
...
Version /var/tmp/portage/binutils-2.15.92.0.2-r7/work/build/binutils/objdump
20040927
Running
/var/tmp/portage/binutils-2.15.92.0.2-r7/work/binutils-2.15.92.0.2/binutils/testsuite/binutils-all/readelf.exp
...
Version /var/tmp/portage/binutils-2.15.92.0.2-r7/work/build/binutils/readelf
20040927
Running
/var/tmp/portage/binutils-2.15.92.0.2-r7/work/binutils-2.15.92.0.2/binutils/testsuite/binutils-all/size.exp
...
Version /var/tmp/portage/binutils-2.15.92.0.2-r7/work/build/binutils/size 20040927
Running
/var/tmp/portage/binutils-2.15.92.0.2-r7/work/binutils-2.15.92.0.2/binutils/testsuite/binutils-all/windres/windres.exp
...

                === binutils Summary ===

# of expected passes            29
# of unexpected failures        3
# of expected failures          1
make[3]: *** [check-DEJAGNU] Error 1
make[3]: Leaving directory
`/var/tmp/portage/binutils-2.15.92.0.2-r7/work/build/binutils'
make[2]: *** [check-am] Error 2
make[2]: Leaving directory
`/var/tmp/portage/binutils-2.15.92.0.2-r7/work/build/binutils'
make[1]: *** [check-recursive] Error 1
make[1]: Leaving directory
`/var/tmp/portage/binutils-2.15.92.0.2-r7/work/build/binutils'
make: *** [check-binutils] Error 2

!!! ERROR: sys-devel/binutils-2.15.92.0.2-r7 failed.
!!! Function toolchain-binutils_src_test, Line 138, Exitcode 2
!!! check failed :(
!!! If you need support, post the topmost build error, NOT this status message.



Reproducible: Always
Steps to Reproduce:
1. emerge =sys-devel/binutils-2.15.92.0.2-r7
2.
3.

Actual Results:  
The emerge procedure stops with an the error:

!!! ERROR: sys-devel/binutils-2.15.92.0.2-r7 failed.
!!! Function toolchain-binutils_src_test, Line 138, Exitcode 2
!!! check failed :(
!!! If you need support, post the topmost build error, NOT this status message.

Expected Results:  
All tests of the testphase should have passed without errors.

I am maintaining an mailserver with exim, amavisd-new and spamassassin.

emerge info output:
Portage 2.0.51.19 (default-linux/x86/2005.0, gcc-3.3.5-20050130,
glibc-2.3.4.20040808-r1, 2.6.11-gentoo-r8 i686)
=================================================================
System uname: 2.6.11-gentoo-r8 i686 Pentium III (Katmai)
Gentoo Base System version 1.4.16
Python:              dev-lang/python-2.3.5 [2.3.5 (#1, May  2 2005, 10:45:45)]
distcc 2.16 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [enabled]
ccache version 2.3 [enabled]
dev-lang/python:     2.3.5
sys-apps/sandbox:    [Not Present]
sys-devel/autoconf:  2.59-r6, 2.13
sys-devel/automake:  1.7.9-r1, 1.8.5-r3, 1.5, 1.4_p6, 1.6.3, 1.9.5
sys-devel/binutils:  2.15.92.0.2-r1
sys-devel/libtool:   1.5.16
virtual/os-headers:  2.6.8.1-r2
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-O2 -march=i686 -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config
/usr/lib/X11/xkb /usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O2 -march=i686 -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs autoconfig ccache distcc distlocks sandbox sfperms strict test"
GENTOO_MIRRORS="http://ftp.iasi.roedu.net/mirrors/gentoo.org/
http://mirror.switch.ch/mirror/gentoo/
ftp://ftp.wh2.tu-dresden.de/pub/mirrors/gentoo
http://ftp.snt.utwente.nl/pub/os/linux/gentoo"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X alsa apm arts avi berkdb bitmap-fonts crypt cups curl emboss encode
foomaticdb fortran gd gdbm gif gpm gtk2 hardened imlib ipv6 jpeg libg++ libwww
mad mikmod motif mp3 mpeg ncurses nls oggvorbis opengl oss pam pdflib perl png
python quicktime readline sdl slang spell ssl svga tcltk tcpd test truetype
truetype-fonts type1-fonts x86 xml2 xmms xv zlib userland_GNU kernel_linux
elibc_glibc"
Unset:  ASFLAGS, CBUILD, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTDIR_OVERLAY
Comment 1 Benno Schulenberg 2005-06-02 05:11:03 UTC
Exactly the same thing here with r10 (binutils-2.15.92.0.2-r10):
  FAIL: run objcopy of executable
  FAIL: run stripped executable
  FAIL: run stripped executable with saving a symbol

Gentoo Base System version 1.6.12
Portage 2.0.51.19 (default-linux/x86/2005.0, gcc-3.3.5-20050130, glibc-2.3.5-r0,
2.6.11 i686)
=================================================================
System uname: 2.6.11 i686 AMD Athlon(tm) XP 2800+
Python:              dev-lang/python-2.3.5 [2.3.5 (#1, May 31 2005, 13:33:00)]
dev-lang/python:     2.3.5
sys-apps/sandbox:    [Not Present]
sys-devel/autoconf:  2.59-r6, 2.13
sys-devel/automake:  1.7.9-r1, 1.8.5-r3, 1.5, 1.4_p6, 1.6.3, 1.9.5
sys-devel/binutils:  2.15.92.0.2-r10
sys-devel/libtool:   1.5.16
virtual/os-headers:  2.6.8-r2
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-march=athlon-xp -Os -pipe -fstack-protector"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.3/env
/usr/kde/3.3/share/config /usr/kde/3.3/shutdown /usr/kde/3.4/env
/usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3/share/config
/usr/lib/X11/xkb /usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-march=athlon-xp -Os -pipe -fstack-protector"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs autoconfig distlocks notitles sandbox sfperms strict test
userpriv usersandbox"
LINGUAS="en eo es nl"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
USE="x86 3dnow X aac aim alsa apm arts avi berkdb bitmap-fonts cdr crypt curl
dlloader doc emboss encode esd fam fbcon ffmpeg flac gd gdbm gif gpm hardened
icq imagemagick imlib jabber jpeg kde kdeenablefinal libg++ libwww lm_sensors
mad mbox mikmod mime mmap mmx mp3 mpeg mysql ncurses nls ogg oggvorbis opengl
pam pdflib png python qt quicktime readline sasl sdl slang speex spell sse ssl
svg svga tcltk threads tidy tiff truetype truetype-fonts tryetype type1-fonts
unicode vorbis wnf xface xine xml xml2 xmms xpm xsl xv xvid yahoo zlib
video_cards_via linguas_en linguas_eo linguas_es linguas_nl userland_GNU
kernel_linux elibc_glibc"
Unset:  ASFLAGS, CBUILD, CTARGET, LANG, LC_ALL, LDFLAGS
Comment 2 SpanKY gentoo-dev 2005-10-04 22:19:13 UTC
sync up and patchset 2.7 should fix things

tested on amd64 and x86
Comment 3 Benno Schulenberg 2005-10-05 04:15:12 UTC
Negative, still the same error:
  [...]
Running
/var/tmp/portage/binutils-2.15.92.0.2-r10/work/binutils-2.15.92.0.2/binutils/testsuite/binutils-all/objcopy.exp
...
Version /var/tmp/portage/binutils-2.15.92.0.2-r10/work/build/binutils/objcopy
20040927
FAIL: run objcopy of executable
FAIL: run stripped executable
FAIL: run stripped executable with saving a symbol
  [...]
!!! ERROR: sys-devel/binutils-2.15.92.0.2-r10 failed.
!!! Function toolchain-binutils_src_test, Line 147, Exitcode 2
!!! check failed :(

Yes, this is with binutils-2.15.92.0.2-patches-2.7.tar.bz2.

Gentoo Base System version 1.12.0_pre8
Portage 2.0.51.22-r2 (default-linux/x86/2005.0, gcc-3.3.6, glibc-2.3.5-r1,
2.6.13 i686)
=================================================================
System uname: 2.6.13 i686 AMD Athlon(tm) XP 2800+
dev-lang/python:     2.3.5-r2
sys-apps/sandbox:    1.2.12
sys-devel/autoconf:  2.13, 2.59-r6
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1
sys-devel/binutils:  2.15.92.0.2-r10
sys-devel/libtool:   1.5.18-r1
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=athlon-xp -Os -pipe -fstack-protector"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.4/env
/usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3/share/config
/usr/lib/X11/xkb /usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-march=athlon-xp -Os -pipe -fstack-protector"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks notitles sandbox sfperms strict test userpriv
usersandbox"
LINGUAS="en eo es nl"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
USE="x86 3dnow X aac aim alsa apm arts avi bash-completion berkdb bitmap-fonts
cdr crypt curl doc dri eds emboss encode esd fam fbcon ffmpeg flac gd gdbm gif
glx gpm gstreamer hardened icq imagemagick imlib jabber jpeg kde kdeenablefinal
libg++ libwww lm_sensors mad mbox mikmod mime mmap mmx mp3 mpeg mysql ncurses
nls ogg oggvorbis opengl pam pdflib png python qt quicktime readline sasl sdl
slang speex spell sse ssl svg svga tcltk threads tidy tiff truetype
truetype-fonts tryetype type1-fonts unicode vorbis win32codecs wnf xface xine
xml xml2 xmms xpm xsl xv xvid yahoo zlib video_cards_via linguas_en linguas_eo
linguas_es linguas_nl userland_GNU kernel_linux elibc_glibc"
Unset:  ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS
Comment 4 SpanKY gentoo-dev 2005-10-05 06:23:40 UTC
post the binutils.log file as an attachment from the build dir then
Comment 5 Kevin F. Quinn (RETIRED) gentoo-dev 2005-12-04 01:55:58 UTC
I get this, on binutils-2.16.1-r1

The first test that fails does 'objcopy testprog copyprog'; the only difference
between the two is that the alignment of the GNU_RELRO segment, which is 0x01 on
testprog and 0x04 on copyprog:

readelf -a testprog > testprog.ra
readelf -a copyprog > copyprog.ra
diff testprog.ra copyprog.ra
--- testprog.ra 2005-12-04 10:24:32.000000000 +0100
+++ copyprog.ra 2005-12-04 10:24:39.000000000 +0100
@@ -73,7 +73,7 @@
   DYNAMIC        0x000ecc 0x00001ecc 0x00001ecc 0x000e0 0x000e0 RW  0x4
   NOTE           0x000168 0x00000168 0x00000168 0x00020 0x00020 R   0x4
   GNU_STACK      0x000000 0x00000000 0x00000000 0x00000 0x00000 RW  0x4
-  GNU_RELRO      0x000eb8 0x00001eb8 0x00001eb8 0x00148 0x00148 R   0x1
+  GNU_RELRO      0x000eb8 0x00001eb8 0x00001eb8 0x00148 0x00148 R   0x4
   PAX_FLAGS      0x000000 0x00000000 0x00000000 0x00000 0x00000     0x4

  Section to Segment mapping:

and to show this is the _only_ difference on the whole executable:

od -t x1 testprog > testprog.x1
od -t x1 copyprog > copyprog.x1
diff testprog.x1 copyprog.x1
--- testprog.x1 2005-12-04 10:34:57.000000000 +0100
+++ copyprog.x1 2005-12-04 10:35:04.000000000 +0100
@@ -17,7 +17,7 @@
 0000400 00 00 00 00 00 00 00 00 00 00 00 00 06 00 00 00
 0000420 04 00 00 00 52 e5 74 64 b8 0e 00 00 b8 1e 00 00
 0000440 b8 1e 00 00 48 01 00 00 48 01 00 00 04 00 00 00
-0000460 01 00 00 00 80 15 04 65 00 00 00 00 00 00 00 00
+0000460 04 00 00 00 80 15 04 65 00 00 00 00 00 00 00 00
 0000500 00 00 00 00 00 00 00 00 00 00 00 00 00 28 00 00
 0000520 04 00 00 00 2f 6c 69 62 2f 6c 64 2d 6c 69 6e 75
 0000540 78 2e 73 6f 2e 32 00 00 04 00 00 00 10 00 00 00


I think the difference is that bfd/elf.c unconditionally sets the alignment of
the GNU_RELRO header as 1 (line 4351), whereas I think objcopy is calculating it
from the size of the section (objcopy.c line 1251).



Comment 6 Kevin F. Quinn (RETIRED) gentoo-dev 2005-12-04 01:58:03 UTC
Created attachment 74035 [details]
Log of binutils test phase
Comment 7 Kevin F. Quinn (RETIRED) gentoo-dev 2005-12-04 01:59:57 UTC
emerge info for completeness

Portage 2.0.51.22-r3 (hardened/x86/2.6, gcc-3.4.4, glibc-2.3.5-r1,
2.6.14-hardened i686)
=================================================================
System uname: 2.6.14-hardened i686 Mobile Intel(R) Pentium(R) III CPU - M  1200MHz
Gentoo Base System version 1.6.13
ccache version 2.3 [enabled]
dev-lang/python:     2.3.5-r2, 2.4.2
sys-apps/sandbox:    1.2.12
sys-devel/autoconf:  2.13, 2.59-r6
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1
sys-devel/binutils:  2.15.92.0.2-r9, 2.15.92.0.2-r10, 2.16-r1, 2.16.1
sys-devel/libtool:   1.5.20
virtual/os-headers:  2.6.11-r3
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-g -O2 -march=pentium3 -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.4/env
/usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3/share/config
/usr/lib/X11/xkb /usr/lib/mozilla/defaults/pref /usr/share/config
/var/qmail/control"
CONFIG_PROTECT_MASK="/etc/eselect /etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-g -O2 -march=pentium3 -pipe"
DISTDIR="/data/g2/distfiles"
FEATURES="autoaddcvs autoconfig ccache cvs digest distlocks fixpackages pax
sandbox sfperms sign strict test userpriv"
GENTOO_MIRRORS="http://localhost/
http://linux.rz.ruhr-uni-bochum.de/download/gentoo-mirror/
http://ftp.linux.ee/pub/gentoo/distfiles/ http://ftp.easynet.nl/mirror/gentoo/
http://ftp.heanet.ie/pub/gentoo/ http://gentoo.osuosl.org/"
LINGUAS="en_GB en it de es fr"
MAKEOPTS="-j2"
PKGDIR="/data/g2/pkgdir"
PORTAGE_TMPDIR="/data/g2/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/var/portage"
SYNC="cvs://kevquinn@cvs.gentoo.org:/var/cvsroot"
USE="X aalib acl acpi alsa apache2 arts audiofile berkdb boundschecking bzip2
cdr crypt cups curl dbus dlloader dvd dvdr encode esd exif expat faad fam ffmpeg
flac foomaticdb fortran gcj gd gdbm ggi gif glut gmp gpm gtk gtk2 hal hardened
idn imagemagick imlib java jce jikes jpeg junit kde kdeenablefinal kerberos lcms
ldap libcaca libwww mad makecheck mbox mhash mikmod mmx mng motif mozilla mp3
mpeg multislot multitarget mysql nas ncurses nls nptl nsplugin odbc ogg opengl
pam pcmcia pcre perl pic png pnp postgres python qt quicktime readline samba sdl
slang sndfile snmp speex sse ssl svga tcltk tcpd test threads tiff truetype
trusted udev unicode usb userlocales vorbis x86 xine xinerama xml2 xmms xprint
xv xvid zlib video_cards_ati linguas_en_GB linguas_en linguas_it linguas_de
linguas_es linguas_fr userland_GNU kernel_linux elibc_glibc"
Unset:  ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS

Comment 8 SpanKY gentoo-dev 2005-12-04 11:22:38 UTC
this is prob because of the new bdirect patch
Comment 9 SpanKY gentoo-dev 2005-12-04 14:06:05 UTC
err no, bdirect wouldnt have anything to do with it

either way, i'm still unable to reproduce this ;)
Comment 10 Kevin F. Quinn (RETIRED) gentoo-dev 2005-12-04 14:23:34 UTC
just built/test with the -Bdirect patch backed out, no change (i.e. still fails).

I've found that 'objcopy x y' on miscellaneous files frequently changes the
alignment of the GNU_RELRO segment.  Don't understand that, yet.

I'll keep looking.
Comment 11 Paul Dunbar 2006-03-28 06:14:24 UTC
Created attachment 83297 [details]
Config logs

Same problem building 2.16.1

 # emerge info
Portage 2.0.54 (default-linux/x86/2006.0, gcc-3.4.5, glibc-2.3.5-r0, 2.6.14-hardened-r3 i686)
=================================================================
System uname: 2.6.14-hardened-r3 i686 Celeron (Coppermine)
Gentoo Base System version 1.6.14
ccache version 2.3 [enabled]
dev-lang/python:     2.3.5-r2, 2.4.2
sys-apps/sandbox:    1.2.12
sys-devel/autoconf:  2.13, 2.59-r7
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1
sys-devel/binutils:  2.16.1
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=i686 -fomit-frame-pointer -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/share/config /var/qmail/control /var/service"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O2 -march=i686 -fomit-frame-pointer -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig ccache distlocks maketest sandbox sfperms strict test userpriv"
GENTOO_MIRRORS="http://mirror.datapipe.net/gentoo ftp://ftp.gtlib.cc.gatech.edu/pub/gentoo ftp://ftp.ussg.iu.edu/pub/linux/gentoo ftp://chod.cwru.edu/gentoo"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="x86 16bit a52 acl aim apache2 apm avi bash-completion berkdb bitmap-fonts bootsplash bzip2 calendar cgi chroot cli crypt ctype curl dba dri eds emboss encode exif expat fam fastbuild fastcgi ffmpeg flac foomaticdb force-cgi-redirect fortran ftp gd gdbm gg gif gmp gpm gstreamer hardened hardenedphp icq idn imagemagick imap imlib ipv6 irc jabber javascript jpeg kde lcms ldap libclamav libg++ libwww lj mad mcal memlimit mhash mikmod ming mmx mng motif mp3 mpeg msn mysql ncurses network nls nptl offensive ogg oscar pam pcre pdflib perl php png posix python quicktime readline rrdtool rss samba sensord session sftplogging simplexml slang soap sockets spell spl ssl symlink tcpd test threads tiff tokenizer tools truetype truetype-fonts type1-fonts udev usb vhosts virus-scan vorbis winbind wmf xml xml2 xmlrpc xsl xvid yahoo zip zlib userland_GNU kernel_linux elibc_glibc"
Unset:  ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS


Original install was 2005.0 - began using FEATURES="test" somewhere around 2005.1
switched to USE="test" and FEATURES="maketest" with 2006.0


Here's the end of the test phase:
Schedule of variations:
    unix

Running target unix
Using /usr/share/dejagnu/baseboards/unix.exp as board description file for target.
Using /usr/share/dejagnu/config/unix.exp as generic interface file for target.
Using /var/tmp/portage/binutils-2.16.1/work/binutils-2.16.1/binutils/testsuite/config/default.exp as tool-and-target-specific interface file.
Running /var/tmp/portage/binutils-2.16.1/work/binutils-2.16.1/binutils/testsuite/binutils-all/ar.exp ...
Running /var/tmp/portage/binutils-2.16.1/work/binutils-2.16.1/binutils/testsuite/binutils-all/dlltool.exp ...
Running /var/tmp/portage/binutils-2.16.1/work/binutils-2.16.1/binutils/testsuite/binutils-all/hppa/objdump.exp ...
Running /var/tmp/portage/binutils-2.16.1/work/binutils-2.16.1/binutils/testsuite/binutils-all/m68k/objdump.exp ...
Running /var/tmp/portage/binutils-2.16.1/work/binutils-2.16.1/binutils/testsuite/binutils-all/nm.exp ...
Version /var/tmp/portage/binutils-2.16.1/work/build/binutils/nm-new 2.16.1
Running /var/tmp/portage/binutils-2.16.1/work/binutils-2.16.1/binutils/testsuite/binutils-all/objcopy.exp ...
Version /var/tmp/portage/binutils-2.16.1/work/build/binutils/objcopy 2.16.1
FAIL: run objcopy of executable
FAIL: run stripped executable
FAIL: run stripped executable with saving a symbol
Running /var/tmp/portage/binutils-2.16.1/work/binutils-2.16.1/binutils/testsuite/binutils-all/objdump.exp ...
Version /var/tmp/portage/binutils-2.16.1/work/build/binutils/objdump 2.16.1
Running /var/tmp/portage/binutils-2.16.1/work/binutils-2.16.1/binutils/testsuite/binutils-all/readelf.exp ...
Version /var/tmp/portage/binutils-2.16.1/work/build/binutils/readelf 2.16.1
Running /var/tmp/portage/binutils-2.16.1/work/binutils-2.16.1/binutils/testsuite/binutils-all/size.exp ...
Version /var/tmp/portage/binutils-2.16.1/work/build/binutils/size 2.16.1
Running /var/tmp/portage/binutils-2.16.1/work/binutils-2.16.1/binutils/testsuite/binutils-all/windres/windres.exp ...

                === binutils Summary ===

# of expected passes            29
# of unexpected failures        3
# of expected failures          1
make[3]: *** [check-DEJAGNU] Error 1
make[3]: Leaving directory `/var/tmp/portage/binutils-2.16.1/work/build/binutils'
make[2]: *** [check-am] Error 2
make[2]: Leaving directory `/var/tmp/portage/binutils-2.16.1/work/build/binutils'
make[1]: *** [check-recursive] Error 1
make[1]: Leaving directory `/var/tmp/portage/binutils-2.16.1/work/build/binutils'
make: *** [check-binutils] Error 2
Comment 12 Benno Schulenberg 2006-06-04 03:54:11 UTC
When using the hardened or hardenednossp compiler, there's still the same problem with binutils-2.16.1-r2.  When using the vanilla or hardenednopiessp compiler, the tests succeed fine.  But when using the hardenednopie compiler, the binutils tests run fine, but errors occur during the ld tests.  An extract:

Running /var/tmp/portage/binutils-2.16.1-r2/work/binutils-2.16.1/ld/testsuite/ld-elfvers/vers.exp ...
FAIL: vers27d3
FAIL: vers27d5
Running /var/tmp/portage/binutils-2.16.1-r2/work/binutils-2.16.1/ld/testsuite/ld-elfvsb/elfvsb.exp ...
FAIL: common hidden symbol
FAIL: weak hidden symbol DSO last
FAIL: weak hidden symbol DSO first
Running /var/tmp/portage/binutils-2.16.1-r2/work/binutils-2.16.1/ld/testsuite/ld-selective/selective.exp ...
FAIL: selective1
FAIL: selective2
FAIL: selective3
Running /var/tmp/portage/binutils-2.16.1-r2/work/binutils-2.16.1/ld/testsuite/ld-srec/srec.exp ...
FAIL: S-records
FAIL: S-records with constructors

		=== ld Summary ===

# of expected passes		233
# of unexpected failures	10
# of expected failures		4


Emerge --info:

Gentoo Base System version 1.12.0
Portage 2.0.54-r2 (default-linux/x86/2006.0, gcc-3.4.6-hardenednopie, glibc-2.3.6-r4, 2.6.16 i686)
=================================================================
System uname: 2.6.16 i686 AMD Athlon(tm) XP 2800+
dev-lang/python:     2.4.2
dev-python/pycrypto: [Not Present]
dev-util/ccache:     [Not Present]
dev-util/confcache:  [Not Present]
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.13, 2.59-r7
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1
sys-devel/binutils:  2.16.1-r2
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=athlon-xp -Os -pipe -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/lib/X11/xkb /usr/share/config"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-march=athlon-xp -O2 -pipe -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks notitles sandbox sfperms strict test userpriv usersandbox"
LANG="en_GB.utf8"
LINGUAS="en eo es nl"
MAKEOPTS="-j1"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
USE="x86 3dnow X aac aim alsa apm arts asf audiofile avi bash-completion berkdb bitmap-fonts bzip2 cdparanoia cdr cli crypt curl dga dio dri dv dvb eds emboss encode ethereal exif expat fam fbcon ffmpeg flac gd gdbm gif glut glx gpm gstreamer gtk gtk2 gtkhtml hardened icq idn imagemagick imap imlib isdnlog jabber jpeg jpeg2k kde kdeenablefinal lcms libg++ libwww lm_sensors lua mad mbox mbrola memlimit mikmod mime mmap mmx mng mp3 mpeg musepack nas ncurses nls nptl nsplugin ogg openal opengl oscar pam pcre pdf pdflib pic png pppd python qt quicktime readline recode reflection sasl scanner sdl session shorten slang sndfile sox speex spell spl sqlite sse ssl svg svga tcltk test theora threads tidy tiff truetype truetype-fonts type1-fonts unicode usb vcd vorbis win32codecs wmf xface xine xml xml2 xorg xpm xsl xv xvid yahoo zlib video_cards_via video_cards_vesa video_cards_fbdev linguas_en linguas_eo linguas_es linguas_nl userland_GNU kernel_linux elibc_glibc"
Unset:  CTARGET, INSTALL_MASK, LC_ALL, LDFLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTAGE_RSYNC_OPTS
Comment 13 Benno Schulenberg 2006-06-04 03:55:30 UTC
Created attachment 88332 [details]
Log of ld test phase.
Comment 14 SpanKY gentoo-dev 2006-09-26 15:28:21 UTC
*** Bug 149151 has been marked as a duplicate of this bug. ***
Comment 15 Jakub Moc (RETIRED) gentoo-dev 2006-12-31 03:28:36 UTC
*** Bug 159558 has been marked as a duplicate of this bug. ***
Comment 16 Joshua Pettett 2007-02-22 02:48:12 UTC
Is there a recommended work-around for this bug?  What are the implications of these test failures?  How much security is lost by compiling with a vanilla gcc?
Comment 17 SpanKY gentoo-dev 2007-02-22 03:26:07 UTC
use FEATURES=-test
Comment 18 Joe Peterson (RETIRED) gentoo-dev 2007-06-21 20:08:19 UTC
On Gentoo/FreeBSD, the tests previously mentioned, plus one more, fail:

FAIL: simple objcopy of executable
FAIL: run objcopy of executable
FAIL: run stripped executable
FAIL: run stripped executable with saving a symbol
Comment 19 Dan Wallis 2007-07-05 05:09:29 UTC
I'm trying to build sys-devel/binutils-2.17 and get these failures:

tui ~ # grep FAIL /var/tmp/portage/sys-devel/binutils-2.17/temp/build.log
FAIL: TLS -fpic -shared transitions
FAIL: TLS descriptor -fpic -shared transitions
FAIL: TLS -fpic and -fno-pic exec transitions
FAIL: TLS descriptor -fpic and -fno-pic exec transitions
FAIL: TLS -fno-pic -shared
FAIL: TLS with global dynamic and descriptors
FAIL: ld-scripts/empty-aligned
tui ~ # 

They don't seem related to the other errors/failures reported in this bug. Shall I open a new bug? Please let me know if more information is required.
Comment 20 Dan Wallis 2007-07-14 04:51:25 UTC
(In reply to comment #19)
I now have another host on which this fails in the same manner:

bookshelf ~ # grep FAIL /var/tmp/portage/sys-devel/binutils-2.17/temp/build.log 
FAIL: TLS -fpic -shared transitions
FAIL: TLS descriptor -fpic -shared transitions
FAIL: TLS -fpic and -fno-pic exec transitions
FAIL: TLS descriptor -fpic and -fno-pic exec transitions
FAIL: TLS -fno-pic -shared
FAIL: TLS with global dynamic and descriptors
FAIL: ld-scripts/empty-aligned
bookshelf ~ # 

Comment 21 SpanKY gentoo-dev 2007-07-14 06:27:05 UTC
people, stop posting your random failures.  this bug is about the objcopy failure that is seen on hardened systems only.  other bugs are for other issues, search bugzilla.
Comment 22 Joshua Pettett 2007-07-31 19:57:15 UTC
This bug is still present in 2.17.

Running /var/tmp/portage/sys-devel/binutils-2.17/work/binutils-2.17/binutils/testsuite/binutils-all/objcopy.exp ...
Version /var/tmp/portage/sys-devel/binutils-2.17/work/build/binutils/objcopy 2.17
FAIL: run objcopy of executable
FAIL: run stripped executable
FAIL: run stripped executable with saving a symbol
Comment 23 Xake 2008-05-14 12:37:52 UTC
Still present with 2.18-r1 and funny thing is that if you dirtyhack the test to make tmpdir/copyprog executable (i.e. adding 'exec chmod +x tmpdir/copyprog') makes all these tests pass. So why does not copyprog becomes executable and what does that have to do with RELRO?
Comment 24 Xake 2009-10-16 12:19:33 UTC
Just to keep this updated:

Still present in binutils git (GNU objcopy (GNU Binutils) 2.20.51.20091016).

Notice how the executable bit are removed by objcopy when adding -pie to the compiler. That is exactly why the testcase cannot execute the file.
Other then that, neither diff or the output of "readelf -a" differs between the files.

$ GCC_SPECS="/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.1/vanilla.specs" gcc -o tmp tmp.c
$ objcopy tmp tmp2
$ ls -l tmp tmp2
-rwxr-xr-x 1 xake xake 8133 16 okt 14.13 tmp
-rwxr-xr-x 1 xake xake 8133 16 okt 14.13 tmp2

$ GCC_SPECS="/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.1/vanilla.specs" gcc -pie -o tmp tmp.c
$ objcopy tmp tmp2
$ ls -l tmp tmp2
-rwxr-xr-x 1 xake xake 8193 16 okt 14.13 tmp
-rw-r--r-- 1 xake xake 8193 16 okt 14.13 tmp2
Comment 25 Xake 2009-10-18 15:22:03 UTC
This is a bug in objcopy that hardened gentoo only exposes, and bugreport have been filed upstream as http://sourceware.org/bugzilla/show_bug.cgi?id=10802.

Could someone with the necessary permissions change the URL to that bugreport, and maybe change the subject to something more appropriate, as this is a bug in objcopy and hardened only exposes it in a more visible way?

How to reproduce on "vanilla" (have tried gentoo on x86 and amd64, and fedora11 on x86):

$ echo "main(){}" > tmp.c && gcc -o tmp tmp.c && objcopy tmp tmp2 && ls
-l tmp tmp2
-rwxr-xr-x 1 xake xake 8081 17 okt 09.12 tmp
-rwxr-xr-x 1 xake xake 8081 17 okt 09.12 tmp2

$ echo "main(){}" > tmp.c && gcc -fPIE -pie -o tmp tmp.c && objcopy tmp
tmp2 && ls -l tmp tmp2
-rwxr-xr-x 1 xake xake 8133 17 okt 09.13 tmp
-rw-r--r-- 1 xake xake 8133 17 okt 09.13 tmp2
Comment 26 Jory A. Pratt gentoo-dev 2009-10-18 15:34:35 UTC
This is actually a bug, hardened has just exposed it as xake has pointed out.
Comment 27 Xake 2009-10-20 12:22:24 UTC
Fixed upstream with this commit:
http://sourceware.org/git/?p=binutils.git;a=commitdiff;h=e6f618dfdbac2d74bf661e6f7f439f4733ccf3eb

Now is this something to incorporate into the patchset or should we just wait for a new upstream release (this is not in 2.20)?
Comment 28 Craig Goodrich 2009-11-16 10:32:31 UTC
(In reply to comment #27)
> Fixed upstream with this commit:
> http://sourceware.org/git/?p=binutils.git;a=commitdiff;h=e6f618dfdbac2d74bf661e6f7f439f4733ccf3eb
> 
> Now is this something to incorporate into the patchset or should we just wait
> for a new upstream release (this is not in 2.20)?
> 

Well, please do SOMETHING; it's been over a month now and this blows up every update that calls for a new binutils.
Comment 29 Xake 2009-11-16 16:06:27 UTC
(In reply to comment #28)
> (In reply to comment #27)
> > Fixed upstream with this commit:
> > http://sourceware.org/git/?p=binutils.git;a=commitdiff;h=e6f618dfdbac2d74bf661e6f7f439f4733ccf3eb
> > 
> > Now is this something to incorporate into the patchset or should we just wait
> > for a new upstream release (this is not in 2.20)?
> > 
> 
> Well, please do SOMETHING; it's been over a month now and this blows up every
> update that calls for a new binutils.
> 

Well, you can always FEATURES="-test" as there will be more failures in the testsuit after this one. There are no regressions compared to what you currently have installed if you use hardened as those failures is because of PIE and have always failed with PIE.
Comment 30 Xake 2010-03-08 11:13:38 UTC
The objcopy tool is fixed in 2.20.1, should we close this bug now?

Other testsuit fails still on hardened, but this particular failing tool (objcopy) is fixed, and other failures should have their own bugs.
Comment 31 SpanKY gentoo-dev 2010-03-08 17:52:28 UTC
sure