Fwd: ld: Wrong error message on unknown -r* and -i* command-line options

2015-01-23 Thread Igor Zhbanov
Hello.

I have found that ld reports confusing message on unsupported
command-line options started with 'r' or 'i':

$ ld -iqwerty
ld: bad -rpath option

$ ld -rqwerty
ld: bad -rpath option

The common case discussed in Internet is incorrectly passing -rdynamic
option to ld.
It's hard to guess what's wrong with -rpath ... when it is also
provided on the command line.

I suggest to print more user-friendly message with complete unsupported option.

Thank you.

___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


ld: Wrong error message on unknown -r* and -i* command-line options

2015-01-23 Thread Igor Zhbanov
Hello.

I have found that ld reports confusing message on unsupported
command-line options started with 'r' or 'i':

$ ld -iqwerty
ld: bad -rpath option

$ ld -rqwerty
ld: bad -rpath option

The common case discussed in Internet is incorrectly passing -rdynamic
option to ld.
It's hard to guess what's wrong with -rpath ... when it is also
provided on the command line.

I suggest to print more user-friendly message with complete unsupported option.

Thank you.

___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug binutils/3298] -mrelax broken for sh-elf

2015-01-23 Thread olegendo at gcc dot gnu.org
https://sourceware.org/bugzilla/show_bug.cgi?id=3298

Oleg Endo  changed:

   What|Removed |Added

 CC||olegendo at gcc dot gnu.org

--- Comment #4 from Oleg Endo  ---
Created attachment 8080
  --> https://sourceware.org/bugzilla/attachment.cgi?id=8080&action=edit
GCC patch to enable -mrelax by default

This is another patch to turn the -mrelax option in GCC by default.

Since PR 10378 and PR 10373 have been fixed, I've tried building GCC with
-mrelaxed enabled by default.  The build would stop in
libgcc/config/sh/lib1funcs.S, where GAS would complain that a mova insn is
referring to an unaligned offset.
After applying the following:

Index: libgcc/config/sh/lib1funcs.S
===
--- libgcc/config/sh/lib1funcs.S(revision 220017)
+++ libgcc/config/sh/lib1funcs.S(working copy)
@@ -116,7 +116,7 @@
 HIDDEN_FUNC(GLOBAL(ashiftrt_r4_31))
 HIDDEN_FUNC(GLOBAL(ashiftrt_r4_32))

-.align1
+.align4
 GLOBAL(ashiftrt_r4_32):
 GLOBAL(ashiftrt_r4_31):
 rotclr4
@@ -765,6 +765,7 @@
 btGLOBAL(movmemSI52)
 ! done all the large groups, do the remainder
 ! jump to movmem+
+.balign 4
 movaGLOBAL(movmemSI4)+4,r0
 addr6,r0
 jmp@r0

GCC (sh-elf C,C++, newlib 2.2.0) can be built successfully.
When compiling a simple C++ program with the resulting toolchain:

#include 

int main (void)
{
  std::cout << "hello world" << std::endl;
  return 0;
}

There are a lot of warnings from LD like:

/usr/local/lib/gcc/sh-elf/5.0.0/../../../../sh-elf/bin/ld:
/usr/local/lib/gcc/sh-elf/5.0.0/../../../../sh-elf/lib/ml/m4/libstdc++.a(locale_init.o):
0x18: warning: symbol in unexpected section
/usr/local/lib/gcc/sh-elf/5.0.0/../../../../sh-elf/bin/ld:
/usr/local/lib/gcc/sh-elf/5.0.0/../../../../sh-elf/lib/ml/m4/libstdc++.a(locale_init.o):
0x6c: warning: symbol in unexpected section
/usr/local/lib/gcc/sh-elf/5.0.0/../../../../sh-elf/bin/ld:
/usr/local/lib/gcc/sh-elf/5.0.0/../../../../sh-elf/lib/ml/m4/libstdc++.a(locale_init.o):
0x70: warning: symbol in unexpected section
/usr/local/lib/gcc/sh-elf/5.0.0/../../../../sh-elf/bin/ld:
/usr/local/lib/gcc/sh-elf/5.0.0/../../../../sh-elf/lib/ml/m4/libstdc++.a(locale_init.o):
0x3c: warning: symbol in unexpected section

But linking somehow succeeds.  However, the resulting program does not work.

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