[Bug ld/24920] Executable produces nonsensical error message after statically linking with trying to link in a dynamic library.

2020-03-13 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=24920

H.J. Lu  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|NEW |RESOLVED

--- Comment #7 from H.J. Lu  ---
Fixed in 2.35 for Linux/x86:

commit 74e10d1742f1b8312359c59a2af06c9e661252b3
Author: H.J. Lu 
Date:   Fri Mar 13 07:34:56 2020 -0700

x86: Check static link of dynamic objects

On Linux/x86, when -static is passed to gcc, gcc passes it to linker
before all input files suitable for creating static executable.  X86
linker will report error for dynamic input objects if -static is passed
at command-line before all input files without --dynamic-linker unless
--no-dynamic-linker is used.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug ld/24920] Executable produces nonsensical error message after statically linking with trying to link in a dynamic library.

2020-03-11 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=24920

H.J. Lu  changed:

   What|Removed |Added

  Attachment #12366|0   |1
is obsolete||

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug ld/24920] Executable produces nonsensical error message after statically linking with trying to link in a dynamic library.

2020-03-11 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=24920

H.J. Lu  changed:

   What|Removed |Added

 Ever confirmed|0   |1
 Status|UNCONFIRMED |NEW
URL||https://sourceware.org/pipe
   ||rmail/binutils/2020-March/1
   ||10196.html
   Last reconfirmed||2020-03-11
   Target Milestone|--- |2.35

--- Comment #6 from H.J. Lu  ---
A patch is posted at

https://sourceware.org/pipermail/binutils/2020-March/110196.html

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug ld/24920] Executable produces nonsensical error message after statically linking with trying to link in a dynamic library.

2020-03-11 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=24920

--- Comment #5 from H.J. Lu  ---
Created attachment 12366
  --> https://sourceware.org/bugzilla/attachment.cgi?id=12366=edit
Try this

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug ld/24920] Executable produces nonsensical error message after statically linking with trying to link in a dynamic library.

2020-03-11 Thread hjl.tools at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=24920

--- Comment #4 from H.J. Lu  ---
(In reply to Geir Johansen from comment #3)
> Problem still occurs with somewhat more recent software:
> 

It is interaction between "gcc -static" and linker -static/-Bdynamic.
When -static is passed to gcc, gcc passes it to linker to create static
binary.  -Bdynamic cancels -static passed from gcc. But gcc only provides
linker options to create static executable, not dynamic executable.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug ld/24920] Executable produces nonsensical error message after statically linking with trying to link in a dynamic library.

2020-03-11 Thread geir at cray dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=24920

--- Comment #3 from Geir Johansen  ---
Problem still occurs with somewhat more recent software:

$ gcc --version
gcc (GCC) 9.2.0 20190812 (Cray Inc.)
Copyright (C) 2019 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.

$ gcc -c hello.c
$ ld --version
GNU ld (GNU Binutils) 2.32
Copyright (C) 2019 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) a later version.
This program has absolutely no warranty.
$ ld -m elf_x86_64 -static /usr/lib64/crt1.o /usr/lib64/crti.o
/opt/gcc/9.2.0/snos/lib/gcc/x86_64-suse-linux/9.2.0/crtbeginT.o
-L/opt/gcc/9.2.0/snos/lib/gcc/x86_64-suse-linux/9.2.0
-L/opt/gcc/9.2.0/snos/lib/lib64 hello.o --start-group -lgcc -lgcc_eh -lc
--end-group /opt/gcc/9.2.0/snos/lib/gcc/x86_64-suse-linux/9.2.0/crtend.o
/usr/lib64/crtn.o -Bdynamic /lib64/libaio.so.1
$ ./a.out
-bash: ./a.out: No such file or directory
$ file a.out
a.out: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), dynamically
linked, interpreter /lib/ld6, for GNU/Linux 3.2.0, with debug_info, not
stripped
$ ldd a.out
linux-vdso.so.1 (0x7ffc5a318000)
libaio.so.1 => /lib64/libaio.so.1 (0x7f1372c2c000)
libc.so.6 => /lib64/libc.so.6 (0x7f1372872000)
/lib/ld64.so.1 => /lib64/ld-linux-x86-64.so.2 (0x7f1372e2e000)
$

-- 
You are receiving this mail because:
You are on the CC list for the bug.


[Bug ld/24920] Executable produces nonsensical error message after statically linking with trying to link in a dynamic library.

2019-08-27 Thread amodra at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=24920

Alan Modra  changed:

   What|Removed |Added

 CC||amodra at gmail dot com,
   ||hjl.tools at gmail dot com

--- Comment #2 from Alan Modra  ---
ld is complying with (older versions of) the x86-64 psABI in supplying
/lib/ld64.so.1.  https://github.com/hjl-tools/x86-psABI says for LP64 that the
default for Linux ought to be /lib64/ld-linux-x86-64.so.2.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug ld/24920] Executable produces nonsensical error message after statically linking with trying to link in a dynamic library.

2019-08-20 Thread fweimer at redhat dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=24920

Florian Weimer  changed:

   What|Removed |Added

 CC||fweimer at redhat dot com

--- Comment #1 from Florian Weimer  ---
This is caused by the link editor defaulting to /lib/ld64.so.1 as the program
interpreter, which does not existing on x86-64 psABI systems.  Without -static,
the gcc compiler driver overrides that, using -dynamic-linker
/lib64/ld-linux-x86-64.so.2.

Maybe ld should not have a default for the program interpreter at all?

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils