[Bug ld/19030] ld generates .so/x86 with bad phdr so the Android linker won't dlopen

2015-10-02 Thread winter-...@bfw-online.de
https://sourceware.org/bugzilla/show_bug.cgi?id=19030

--- Comment #5 from winter-...@bfw-online.de ---
> Yes, one dash or two makes a difference.

Using single-dash arguments can then be considered pretty dangerous in ld since
any small typo (or using a parameter that might only exist in some other ld
version) in the argument results in ld looking for single letter arguments
(even in concatenation) which it almost always find.

$ ld -nostdlib # correct
$ ld -nostdllib # incorrect, results in -n -o stdllib

Much safer is double dash:

$ ld --nostdlib # correct
$ ld --nostdllib
ld: unrecognized option '--nostdllib'

I figure a lot of people and application rely on single letter concatenation
like this, but probably also a lot of people suffer from incorrectly applied
settings without even knowing.

-- 
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/19030] ld generates .so/x86 with bad phdr so the Android linker won't dlopen

2015-10-01 Thread ian at airs dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=19030

Ian Lance Taylor  changed:

   What|Removed |Added

 CC||ian at airs dot com

--- Comment #4 from Ian Lance Taylor  ---
The option -no-enum-size-warning is handled as -n -o -enum-size-warning.  In
other words, the -n option, followed by the -o option, setting the name of the
output file to -enum-size-warning.  Perhaps in your case you had a subsequent
-o option setting a different output file name--that last -o option on the
command line takes precedence.

Yes, one dash or two makes a difference.

-- 
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/19030] ld generates .so/x86 with bad phdr so the Android linker won't dlopen

2015-10-01 Thread winter-...@bfw-online.de
https://sourceware.org/bugzilla/show_bug.cgi?id=19030

--- Comment #3 from winter-...@bfw-online.de ---
Even worse, the actual error is the missing dash in the beginning.
"--no-enum-size-warning" *is* a ld parameter but without the first dash it
behaves like "-n".

-- 
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/19030] ld generates .so/x86 with bad phdr so the Android linker won't dlopen

2015-10-01 Thread winter-...@bfw-online.de
https://sourceware.org/bugzilla/show_bug.cgi?id=19030

--- Comment #2 from winter-...@bfw-online.de ---
Your analysis is correct, thank you.

While "-nostdlib" actually is a ld option (at least in my ld according to
--help and man page), I rechecked and noticed I passed another gcc parameter
"-no-enum-size-warning" to ld which seems to behave like "-n" as you suggested
hence you can label this as user error but I keep wondering how this parameter
handling could be useful/intended.

The man page says "For options whose names are a single letter, option
arguments must either follow the option letter without intervening whitespace,
or be given as separate arguments immediately following the option that
requires them." so "-no-enum-size-warning" would be taken as "-n" with value
"o-enum-size-warning". Yet according to the man page "-n" does not take a
value, so it seems the trailing characters will be silently discarded.

Is this parameter-handling behavior intended this way? (Should one open a new
bug to discuss that?)

-- 
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/19030] ld generates .so/x86 with bad phdr so the Android linker won't dlopen

2015-10-01 Thread amodra at gmail dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=19030

Alan Modra  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||amodra at gmail dot com
 Resolution|--- |INVALID

--- Comment #1 from Alan Modra  ---
-nostdlib is a gcc option, not a ld option.  It looks to me like your version
of ld is treating the option as if it were -n.

-- 
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