Bug 18509 - 16 unexpected failures for "ld" during "make check" for binutils 2.24
Summary: 16 unexpected failures for "ld" during "make check" for binutils 2.24
Status: RESOLVED FIXED
Alias: None
Product: binutils
Classification: Unclassified
Component: binutils (show other bugs)
Version: 2.24
: P2 critical
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-06-09 18:50 UTC by Yuhang Wang
Modified: 2015-08-06 00:42 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments
Results of "make check" (3.55 KB, text/plain)
2015-06-09 18:50 UTC, Yuhang Wang
Details
Log file for "make check" (3.65 KB, text/plain)
2015-07-30 18:47 UTC, Yuhang Wang
Details
ld/ld.log file from the binutils compilation directory (91.88 KB, text/x-log)
2015-07-31 16:17 UTC, Yuhang Wang
Details
ld/ld.log after adding LDFLAGS and run the "make check" again (38.37 KB, text/x-log)
2015-07-31 17:56 UTC, Yuhang Wang
Details
ld.log after using the new site.exp with DEJAGNU env variable pointing to it (91.54 KB, text/x-log)
2015-08-03 16:24 UTC, Yuhang Wang
Details
results of make when building the lastest master branch of binutils (2.74 KB, text/x-log)
2015-08-03 21:42 UTC, Yuhang Wang
Details
log file for `make check` after compiling the master branch of binutils (3.70 KB, text/plain)
2015-08-03 22:14 UTC, Yuhang Wang
Details
ld/ld.log for the latest master branch of binutils (258.83 KB, text/plain)
2015-08-04 00:12 UTC, Yuhang Wang
Details
ld/ld.log compiled using system gcc (4.4.7) (157.98 KB, text/x-log)
2015-08-04 15:56 UTC, Yuhang Wang
Details
libtlslib.so (600 bytes, application/x-sharedlib)
2015-08-04 17:37 UTC, Yuhang Wang
Details
tlsbin (1.62 KB, application/x-executable)
2015-08-04 17:40 UTC, Yuhang Wang
Details
tlsbin.o (624 bytes, application/x-object)
2015-08-04 17:40 UTC, Yuhang Wang
Details
tlsbinpic.o (807 bytes, application/x-object)
2015-08-04 17:40 UTC, Yuhang Wang
Details
tlslib.o (266 bytes, application/x-object)
2015-08-04 17:41 UTC, Yuhang Wang
Details
libtlslib.so with LD_LIBRARY_PATH unset (600 bytes, application/x-sharedlib)
2015-08-05 15:37 UTC, Yuhang Wang
Details
ld/ld.log after unsetting LD_LIBRARY_PATH (157.98 KB, text/x-log)
2015-08-05 15:38 UTC, Yuhang Wang
Details
ld/ld.log after unsetting LD_RUN_PATH (152.84 KB, text/x-log)
2015-08-05 21:40 UTC, Yuhang Wang
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Yuhang Wang 2015-06-09 18:50:19 UTC
Created attachment 8354 [details]
Results of "make check"

Dear binutils developers,

I have just compiled binutils 2.24. The compilation step was fine. However, the 
"make check" result showed 16 unexpected failures for "ld". The errors are consistent even for binutils 2.23.2 and 2.25.
My system environment:

* CentOS 6.6
* x86_64 architecture (Intel(R) Xeon(R) CPU W3550  @ 3.07GHz)
* Tools used for installation:
  1) libiconv/1.14
  2) zlib/1.2.8
  3) isl/0.12.2
  4) texinfo
  5) dejagnu
  6) gcc/4.7.4 (non-system gcc)

* build command:
../binutils-2.24/configure --prefix=/Scr/scr-test-steven/install/binutils/2.24 --enable-shared --enable-static --enable-plugins  --with-zlib=yes --with-libiconv-prefix=/Scr/scr-test-steven/install/libiconv/1.14 --enable-build-warnings=yes  CC=/Scr/scr-test-steven/install/gcc/4.7.4/bin/gcc CXX=/Scr/scr-test-steven/install/gcc/4.7.4/bin/g++

* rpm -q glibc
glibc-2.12-1.149.el6_6.9.x86_64
glibc-2.12-1.149.el6_6.9.i686



The failed tests are:
FAIL: static preinit array                                                                                                              
FAIL: static init array                                                                                                                 
FAIL: static fini array                                                                                                                 
FAIL: static init array mixed    

FAIL: TLS -fpic and -fno-pic exec transitions                                                                                           
FAIL: TLS descriptor -fpic and -fno-pic exec transitions                                                                                
FAIL: TLS -fno-pic -shared 

FAIL: Could not link a static executable      

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 with global dynamic and descriptors                                                                                           
FAIL: TLS GD->IE transition                                                                                                             
FAIL: TLS X32 GD->IE transition                                                                                                         
FAIL: ld-x86-64/ilp32-4 


Please let me know how to fix this. Thanks!

Yuhang Wang
Comment 1 Nick Clifton 2015-07-16 14:33:15 UTC
Hi Yuhang,

  I have been unable to reproduce these testsuite failures. :-(

  If you can reproduce them with a toolchain built using the latest development sources then please could you upload the log file so that I can investigate further.

Cheers
  Nick
Comment 2 Yuhang Wang 2015-07-16 15:28:07 UTC
Yes, I can try again with the latest source.
Comment 3 Yuhang Wang 2015-07-30 18:47:34 UTC
Created attachment 8461 [details]
Log file for "make check"

This is the log file for the command "make check" after "make"
Comment 4 Yuhang Wang 2015-07-30 18:50:37 UTC
Hi Nick,

Sorry for the delay. I have compiled binutils-2.25.1 and still got the same type of errors at the "make check" stage (see attached log files). Here is the command line options I used.

../binutils-2.25.1/configure --prefix=/Scr/scr-test-steven/install/binutils/2.25.1 --enable-shared --enable-static --enable-plugins  --with-zlib=yes --with-libiconv-prefix=/Scr/scr-test-steven/install/libiconv/1.14 --enable-build-warnings=yes  CC=/Scr/scr-test-steven/install/gcc/4.9.2/bin/gcc CXX=/Scr/scr-test-steven/install/gcc/4.9.2/bin/g++


Do you think I should compile everything in the same folder as the source file instead?


Yuhang
Comment 5 Nick Clifton 2015-07-31 15:22:49 UTC
Hi Yuhang,

> Do you think I should compile everything in the same folder as the source file 
> instead?

No, that will not help.

Please could you upload the ld.log file from the failed tests, so that I can examine it ?

Cheers
  Nick
Comment 6 Yuhang Wang 2015-07-31 16:17:50 UTC
Created attachment 8464 [details]
ld/ld.log file from the binutils compilation directory
Comment 7 Yuhang Wang 2015-07-31 16:18:57 UTC
Hi Nick,

I have uploaded the ld.log file. Please take a look. Thanks!


Yuhang
Comment 8 Nick Clifton 2015-07-31 16:29:04 UTC
Hi Yuhang,

  Have you looked in the log file yourself ?  If you do, you will see that about half of the failures are because the z library is missing.  Eg:

  /Scr/scr-test-steven/Programs/BinUtils/build_binutils-2.25.1/ld/.libs/lt-ld-new: skipping incompatible /usr/local/lib/libz.a when searching for -lz
  /Scr/scr-test-steven/Programs/BinUtils/build_binutils-2.25.1/ld/.libs/lt-ld-new: cannot find -lz
  FAIL: static preinit array

The other failures appear to be due to very minor changes in the sections in the output binaries, which are not matching with the expected values.  eg:

  regexp_diff match failure
  regexp "^ +\[[ 0-9]+\] \.got +PROGBITS +0+804a100 .*$"
line   "  [12] .got              PROGBITS        0804a108 002108 000024 04  WA  0   0  4"
  regexp_diff match failure
  regexp "^ +\[[ 0-9]+\] \.got\.plt +PROGBITS +0+804a124 .*$"
line   "  [13] .got.plt          PROGBITS        0804a12c 00212c 000010 04  WA  0   0  4"
  FAIL: TLS -fpic and -fno-pic exec transitions

Personally I would consider this a flaw in the test itself, not the linker.  The tests should allow for some variations in the section details unless there is good reason to expect exact values.

My recommendation - install the zlib package and ignore the other failures.

Cheers
  Nick
Comment 9 Yuhang Wang 2015-07-31 16:45:14 UTC
Hi Nick,

I will compile again with zlib and let you know the results. Thank you for pointing that out.

Yuhang
Comment 10 Yuhang Wang 2015-07-31 17:56:55 UTC
Created attachment 8467 [details]
ld/ld.log after adding LDFLAGS and run the "make check" again
Comment 11 Yuhang Wang 2015-07-31 17:58:26 UTC
Hi Nick,

I have add "LDFLAGS=-L/Scr/scr-test-steven/install/zlib/1.2.8/lib" during the configuration phase and the Makefile under ld/ folder is also updated with a new LDFLAGS:
LDFLAGS = -static-libstdc++ -static-libgcc -L/Scr/scr-test-steven/install/zlib/1.2.8/lib

However, the make check still can't find the correct version the zlib (see the new ld.log). Could you give me some pointers? Thanks!

P.S.
Here is the new configure option line:
../binutils-2.25.1/configure --prefix=/Scr/scr-test-steven/install/binutils/2.25.1  CC=/Scr/scr-test-steven/install/gcc/4.9.2/bin/gcc CXX=/Scr/scr-test-steven/install/gcc/4.9.2/bin/g++ LDFLAGS=-L/Scr/scr-test-steven/install/zlib/1.2.8/lib

Yuhang
Comment 12 Nick Clifton 2015-08-03 07:33:53 UTC
Hi Yuhang,

  You need to set LD_LIBRARY_PATH rather than LDFLAGS in order to locate libraries when executables are run.  So what you need to do is to either set LD_LIBRARY_PATH in your environment, or else add it to the site.exp file pointed to be your DEJAGNU environment variable.  Ie, something like this:

  % export DEJAGNU=`pwd`/site.exp
  % cat site.exp

# Make sure we look in the right place for the board description files.
if ![info exists boards_dir] {
    set boards_dir {}
}


# Determine target machines for all known targets
verbose "Global Config File: target_triplet is $target_triplet" 2
global target_list

# Note the following list is alpha sorted in order to help maintain it.
case "$target_triplet" in {
    {   i*86-pc-*
	x86_64-pc-*
	native
	i*86-redha4t-linux-gnu } {
	    set LD_LIBRARY_PATH "/usr/local/lib:/Scr/scr-test-steven/install/zlib/1.2.8/lib/"
	    set target_list "unix"
	}
}

  I hope that this helps.

Cheers
  Nick
Comment 13 H.J. Lu 2015-08-03 15:45:47 UTC
FWIW, since the in-tree zlib is enabled on master branch, this
problem will go away automatically with binutils 2.26.
Comment 14 Yuhang Wang 2015-08-03 16:20:24 UTC
Hi Nick,

The zlib I mentioned is already in the LD_LIBRARY_PATH. Here is the result of "echo $LD_LIBRARY_PATH":
/Scr/scr-test-steven/install/gcc/4.9.2/lib64:/Scr/scr-test-steven/install/gcc/4.9.2/lib:/Scr/scr-test-steven/install/zlib/1.2.8/lib:/Scr/scr-test-steven/install/lua/5.3.1/lib:/usr/local/globus/lib:/lib64:/usr/lib64:/usr/local/lib64:/lib:/usr/lib:/usr/local/lib:/Scr/scr-test-steven/install/miniconda/lib

I have also created  a site.exp file with the content you mentioned at the root of the build folder and also set the DEJAGNU environment variable to `pwd`/site.exp. However, "make check" sill couldn't find the correct version of zlib.

Yuhang
Comment 15 Yuhang Wang 2015-08-03 16:24:28 UTC
Created attachment 8475 [details]
ld.log after using the new site.exp with DEJAGNU env variable pointing to it
Comment 16 Yuhang Wang 2015-08-03 16:27:59 UTC
Hi H. J. Lu,

Could you tell me how to get binutils-2.26? I couldn't find it on the release page:  http://ftp.gnu.org/gnu/binutils/

Yuhang
Comment 17 H.J. Lu 2015-08-03 21:20:29 UTC
(In reply to Yuhang Wang from comment #16)
> Hi H. J. Lu,
> 
> Could you tell me how to get binutils-2.26? I couldn't find it on the
> release page:  http://ftp.gnu.org/gnu/binutils/

The master branch will be called 2.26 when it is released.  You can get
it via git.
Comment 18 Yuhang Wang 2015-08-03 21:41:46 UTC
Hi H. J. Lu,

Thanks. I cloned the master branch. This new version seems to require python and I got some errors related to PyUnicodeUCS4_Decode (see attached log). Any suggestions on how to fix it? 

Yuhang
Comment 19 Yuhang Wang 2015-08-03 21:42:29 UTC
Created attachment 8478 [details]
results of make when building the lastest master branch of binutils
Comment 20 H.J. Lu 2015-08-03 21:48:01 UTC
(In reply to Yuhang Wang from comment #18)
> Hi H. J. Lu,
> 
> Thanks. I cloned the master branch. This new version seems to require python
> and I got some errors related to PyUnicodeUCS4_Decode (see attached log).
> Any suggestions on how to fix it? 

Try configure binutils with

--enable-plugins --disable-gdb --disable-libdecnumber --disable-readline --disable-sim
Comment 21 Yuhang Wang 2015-08-03 22:13:35 UTC
Hi,

I have compiled the master branch of the binutils. Here is the log file for `make check`. I sill got many errors for ld. Do you think they are significant or can be ignored?

                === ld Summary ===

# of expected passes            1144
# of unexpected failures        25
# of expected failures          57
# of untested testcases         1
# of unsupported tests          12
Comment 22 Yuhang Wang 2015-08-03 22:14:45 UTC
Created attachment 8479 [details]
log file for `make check` after compiling the master branch of binutils

Here is config command:
../binutils-latest/configure --prefix=/Scr/scr-test-steven/install/binutils/latest  CC=/Scr/scr-test-steven/install/gcc/4.9.2/bin/gcc CXX=/Scr/scr-test-steven/install/gcc/4.9.2/bin/g++ --enable-plugins --disable-gdb --disable-libdecnumber --disable-readline --disable-sim
Comment 23 H.J. Lu 2015-08-03 23:22:24 UTC
(In reply to Yuhang Wang from comment #22)
> Created attachment 8479 [details]
> log file for `make check` after compiling the master branch of binutils
> 

What is in ld.log?
Comment 24 Yuhang Wang 2015-08-04 00:12:46 UTC
Created attachment 8480 [details]
ld/ld.log for the latest master branch of binutils

I forgot to attach the ld.log. Here it is.
Comment 25 H.J. Lu 2015-08-04 01:35:27 UTC
How did you configure GCC 4.9.2? Did you make any changes to GCC 4.9.2?
Comment 26 Yuhang Wang 2015-08-04 01:54:20 UTC
I just disabled multi-lib. Here is the config command I used to build gcc-4.9.2:

../gcc-4.9.2/configure --prefix=/Scr/scr-test-steven/install/gcc/4.9.2 --disable-multilib --with-gmp=/Scr/scr-test-steven/install/libgmp/4.3.2 --with-mpfr=/Scr/scr-test-steven/install/libmpfr/2.4.2 --with-mpc=/Scr/scr-test-steven/install/libmpc/0.8.1 --with-cloog=/Scr/scr-test-steven/install/libcloog/0.18.1 --with-isl=/Scr/scr-test-steven/install/libisl/0.12.2  CC=/Scr/scr-test-steven/install/gcc/4.7.4/bin/gcc CXX=/Scr/scr-test-steven/install/gcc/4.7.4/bin/g++ CPPFLAGS=-I/Scr/scr-test-steven/install/gcc/4.7.4/include LDFLAGS=-L/Scr/scr-test-steven/install/gcc/4.7.4/lib64
Comment 27 H.J. Lu 2015-08-04 04:04:45 UTC
(In reply to Yuhang Wang from comment #26)
> I just disabled multi-lib. Here is the config command I used to build
> gcc-4.9.2:
>

What is your system GCC? Have you tried it on binutils?
Comment 28 Yuhang Wang 2015-08-04 04:28:22 UTC
The system gcc version is 4.4. I will try again tomorrow.
Comment 29 Yuhang Wang 2015-08-04 15:55:38 UTC
With the system gcc (4.4.7 20120313 Red Hat 4.4.7-11), the number of unexpected failures dropped to 18 (from 25). Here is the ld.log.
=== ld Summary ===
# of expected passes            1151
# of unexpected failures        18
# of expected failures          57
# of untested testcases         1
# of unsupported tests          12
Comment 30 Yuhang Wang 2015-08-04 15:56:17 UTC
Created attachment 8481 [details]
ld/ld.log compiled using system gcc (4.4.7)

=== ld Summary ===
# of expected passes            1151
# of unexpected failures        18
# of expected failures          57
# of untested testcases         1
# of unsupported tests          12
Comment 31 H.J. Lu 2015-08-04 16:57:57 UTC
Please run

/Scr/scr-test-steven/Programs/BinUtils/build_binutils-latest/ld/../gas/as-new   -I/Scr/scr-test-steven/Programs/BinUtils/binutils-latest/ld/testsuite/ld-i386   -o tmpdir/tlslib.o --32 /Scr/scr-test-steven/Programs/BinUtils/binutils-latest/ld/testsuite/ld-i386/tlslib.s
/Scr/scr-test-steven/Programs/BinUtils/build_binutils-latest/ld/ld-new   -o tmpdir/libtlslib.so -L/Scr/scr-test-steven/Programs/BinUtils/binutils-latest/ld/testsuite/ld-i386 -shared -melf_i386 tmpdir/tlslib.o 
/Scr/scr-test-steven/Programs/BinUtils/build_binutils-latest/ld/../gas/as-new   -I/Scr/scr-test-steven/Programs/BinUtils/binutils-latest/ld/testsuite/ld-i386   -o tmpdir/tlsbinpic.o --32 /Scr/scr-test-steven/Programs/BinUtils/binutils-latest/ld/testsuite/ld-i386/tlsbinpic.s
/Scr/scr-test-steven/Programs/BinUtils/build_binutils-latest/ld/../gas/as-new   -I/Scr/scr-test-steven/Programs/BinUtils/binutils-latest/ld/testsuite/ld-i386   -o tmpdir/tlsbin.o --32 /Scr/scr-test-steven/Programs/BinUtils/binutils-latest/ld/testsuite/ld-i386/tlsbin.s
/Scr/scr-test-steven/Programs/BinUtils/build_binutils-latest/ld/ld-new   -o tmpdir/tlsbin -L/Scr/scr-test-steven/Programs/BinUtils/binutils-latest/ld/testsuite/ld-i386 -melf_i386 tmpdir/libtlslib.so --no-ld-generated-unwind-info tmpdir/tlsbinpic.o tmpdir/tlsbin.o 

and upload tmpdir/tlsbin tmpdir/libtlslib.so tmpdir/tlsbinpic.o tmpdir/tlsbin.o
Comment 32 Yuhang Wang 2015-08-04 17:37:59 UTC
Created attachment 8482 [details]
libtlslib.so

/Scr/scr-test-steven/Programs/BinUtils/build_binutils-latest/ld/ld-new   -o tmpdir/libtlslib.so -L/Scr/scr-test-steven/Programs/BinUtils/binutils-latest/ld/testsuite/ld-i386 -shared -melf_i386 tmpdir/tlslib.o
Comment 33 Yuhang Wang 2015-08-04 17:40:00 UTC
Created attachment 8483 [details]
tlsbin

 /Scr/scr-test-steven/Programs/BinUtils/build_binutils-latest/ld/ld-new   -o tmpdir/tlsbin -L/Scr/scr-test-steven/Programs/BinUtils/binutils-latest/ld/testsuite/ld-i386 -melf_i386 tmpdir/libtlslib.so --no-ld-generated-unwind-info tmpdir/tlsbinpic.o tmpdir/tlsbin.o
Comment 34 Yuhang Wang 2015-08-04 17:40:27 UTC
Created attachment 8484 [details]
tlsbin.o

/Scr/scr-test-steven/Programs/BinUtils/build_binutils-latest/ld/../gas/as-new   -I/Scr/scr-test-steven/Programs/BinUtils/binutils-latest/ld/testsuite/ld-i386   -o tmpdir/tlsbin.o --32 /Scr/scr-test-steven/Programs/BinUtils/binutils-latest/ld/testsuite/ld-i386/tlsbin.s
Comment 35 Yuhang Wang 2015-08-04 17:40:54 UTC
Created attachment 8485 [details]
tlsbinpic.o

/Scr/scr-test-steven/Programs/BinUtils/build_binutils-latest/ld/../gas/as-new   -I/Scr/scr-test-steven/Programs/BinUtils/binutils-latest/ld/testsuite/ld-i386   -o tmpdir/tlsbinpic.o --32 /Scr/scr-test-steven/Programs/BinUtils/binutils-latest/ld/testsuite/ld-i386/tlsbinpic.s
Comment 36 Yuhang Wang 2015-08-04 17:41:20 UTC
Created attachment 8486 [details]
tlslib.o

/Scr/scr-test-steven/Programs/BinUtils/build_binutils-latest/ld/ld-new   -o tmpdir/libtlslib.so -L/Scr/scr-test-steven/Programs/BinUtils/binutils-latest/ld/testsuite/ld-i386 -shared -melf_i386 tmpdir/tlslib.o
Comment 37 Yuhang Wang 2015-08-04 19:18:49 UTC
I have uploaded the binary files as you specified. Let me know whether you need anything else. Thanks.
Comment 38 H.J. Lu 2015-08-04 21:02:00 UTC
Please show me

# echo $LD_RUN_PATH
# echo $LD_LIBRARY_PATH
Comment 39 Yuhang Wang 2015-08-04 23:54:19 UTC
echo $LD_RUN_PATH returns nothing.
echo $LD_LIBRARY_PATH returns the following:
/Scr/scr-test-steven/install/zlib/1.2.8/lib:/Scr/scr-test-steven/install/lua/5.3.1/lib:/usr/local/globus/lib:/lib64:/usr/lib64:/usr/local/lib64:/lib:/usr/lib:/usr/local/lib
Comment 40 H.J. Lu 2015-08-05 13:22:24 UTC
(In reply to Yuhang Wang from comment #39)
> echo $LD_RUN_PATH returns nothing.
> echo $LD_LIBRARY_PATH returns the following:
> /Scr/scr-test-steven/install/zlib/1.2.8/lib:/Scr/scr-test-steven/install/lua/
> 5.3.1/lib:/usr/local/globus/lib:/lib64:/usr/lib64:/usr/local/lib64:/lib:/usr/
> lib:/usr/local/lib

Please unset LD_LIBRARY_PATH.  If it still fails, please upload
libtlslib.so from

/Scr/scr-test-steven/Programs/BinUtils/build_binutils-latest/ld/ld-new   -o tmpdir/libtlslib.so -L/Scr/scr-test-steven/Programs/BinUtils/binutils-latest/ld/testsuite/ld-i386 -shared -melf_i386 tmpdir/tlslib.o
Comment 41 Yuhang Wang 2015-08-05 15:36:54 UTC
I sill got 18 errors after unsetting LD_LIBRARY_PATH.
Comment 42 Yuhang Wang 2015-08-05 15:37:55 UTC
Created attachment 8487 [details]
libtlslib.so with LD_LIBRARY_PATH unset

/Scr/scr-test-steven/Programs/BinUtils/build_binutils-latest/ld/ld-new -o tmpdir/libtlslib.so -L/Scr/scr-test-steven/Programs/BinUtils/binutils-latest/ld/testsuite/ld-i386 -shared -melf_i386 tmpdir/tlslib.o
Comment 43 Yuhang Wang 2015-08-05 15:38:24 UTC
Created attachment 8488 [details]
ld/ld.log after unsetting LD_LIBRARY_PATH
Comment 44 H.J. Lu 2015-08-05 17:44:59 UTC
(In reply to Yuhang Wang from comment #39)
> echo $LD_RUN_PATH returns nothing.

Please show me

# env | grep LD_RUN_PATH
Comment 45 Yuhang Wang 2015-08-05 18:55:07 UTC
env | grep LD_RUN_PATH
LD_RUN_PATH=
Comment 46 H.J. Lu 2015-08-05 19:52:23 UTC
(In reply to Yuhang Wang from comment #45)
> env | grep LD_RUN_PATH
> LD_RUN_PATH=

Please unset LD_RUN_PATH.
Comment 47 Yuhang Wang 2015-08-05 21:39:47 UTC
No more unexpected failures after "unsetenv LD_RUN_PATH". 
Could you tell me what is the reason for previous issues? 

Here is the summary:

=== ld Summary ===

# of expected passes            1169
# of expected failures          57
# of untested testcases         1
# of unsupported tests          12

=== gas Summary ===

# of expected passes            937


=== binutils Summary ===

# of expected passes            143
# of unsupported tests          1
Comment 48 Yuhang Wang 2015-08-05 21:40:42 UTC
Created attachment 8489 [details]
ld/ld.log after unsetting LD_RUN_PATH
Comment 49 H.J. Lu 2015-08-05 22:07:56 UTC
(In reply to Yuhang Wang from comment #47)
> No more unexpected failures after "unsetenv LD_RUN_PATH". 
> Could you tell me what is the reason for previous issues? 
> 

Setting LD_RUN_PATH changes the linker output.
Comment 50 Yuhang Wang 2015-08-05 22:13:24 UTC
I have just added back LD_LIBRARY_PATH, and all the tests went well (no unexpected failures). So the culprit is indeed LD_RUN_PATH. Do you recommend always leave LD_RUN_PATH unset, or make LD_RUN_PATH the same as LD_LIBARAY_PATH? By the way, why the linker still works fine without LD_RUN_PATH?
Comment 51 H.J. Lu 2015-08-05 23:25:40 UTC
(In reply to Yuhang Wang from comment #50)
> I have just added back LD_LIBRARY_PATH, and all the tests went well (no
> unexpected failures). So the culprit is indeed LD_RUN_PATH. Do you recommend
> always leave LD_RUN_PATH unset, or make LD_RUN_PATH the same as
> LD_LIBARAY_PATH? By the way, why the linker still works fine without
> LD_RUN_PATH?

The only thing I can tell you is I don't use LD_RUN_PATH myself.
Comment 52 Yuhang Wang 2015-08-06 00:42:00 UTC
Thanks H. J. Lu and Nick for helping me out! I appreciate your time and effort.