public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug driver/66737] New: ld: warning: -z bndplt ignored
@ 2015-07-02 11:10 hjl.tools at gmail dot com
  2015-07-16 13:05 ` [Bug driver/66737] " ienkovich at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: hjl.tools at gmail dot com @ 2015-07-02 11:10 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66737

            Bug ID: 66737
           Summary: ld: warning: -z bndplt ignored
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: driver
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hjl.tools at gmail dot com
                CC: ienkovich at gcc dot gnu.org
  Target Milestone: ---

[hjl@gnu-6 gcc]$ cat x.c
int
main ()
{
  return 0;
}
[hjl@gnu-6 gcc]$ gcc -mmpx x.c -m32 -fcheck-pointer-bounds
/usr/local/bin/ld: warning: -z bndplt ignored.
[hjl@gnu-6 gcc]$ 

-z bndplt is only needed for x86-64 linker.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug driver/66737] ld: warning: -z bndplt ignored
  2015-07-02 11:10 [Bug driver/66737] New: ld: warning: -z bndplt ignored hjl.tools at gmail dot com
@ 2015-07-16 13:05 ` ienkovich at gcc dot gnu.org
  2015-07-16 13:40 ` hjl.tools at gmail dot com
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: ienkovich at gcc dot gnu.org @ 2015-07-16 13:05 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66737

--- Comment #1 from Ilya Enkovich <ienkovich at gcc dot gnu.org> ---
Why don't we need it for 32bit? What if we use calling convention allowing args
on registers?


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug driver/66737] ld: warning: -z bndplt ignored
  2015-07-02 11:10 [Bug driver/66737] New: ld: warning: -z bndplt ignored hjl.tools at gmail dot com
  2015-07-16 13:05 ` [Bug driver/66737] " ienkovich at gcc dot gnu.org
@ 2015-07-16 13:40 ` hjl.tools at gmail dot com
  2015-07-16 14:32 ` hjl.tools at gmail dot com
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: hjl.tools at gmail dot com @ 2015-07-16 13:40 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66737

H.J. Lu <hjl.tools at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2015-07-16
   Target Milestone|---                         |6.0
     Ever confirmed|0                           |1

--- Comment #2 from H.J. Lu <hjl.tools at gmail dot com> ---
(In reply to Ilya Enkovich from comment #1)
> Why don't we need it for 32bit? What if we use calling convention allowing
> args on registers?

We don't need it for 32-bit.  That is the bug here.  -z bndplt should be
passed to linker only for 64-bit.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug driver/66737] ld: warning: -z bndplt ignored
  2015-07-02 11:10 [Bug driver/66737] New: ld: warning: -z bndplt ignored hjl.tools at gmail dot com
  2015-07-16 13:05 ` [Bug driver/66737] " ienkovich at gcc dot gnu.org
  2015-07-16 13:40 ` hjl.tools at gmail dot com
@ 2015-07-16 14:32 ` hjl.tools at gmail dot com
  2015-07-16 14:43 ` ienkovich at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: hjl.tools at gmail dot com @ 2015-07-16 14:32 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66737

--- Comment #3 from H.J. Lu <hjl.tools at gmail dot com> ---
(In reply to Ilya Enkovich from comment #1)
> Why don't we need it for 32bit? What if we use calling convention allowing
> args on registers?

You can only safely pass arguments in registers when calling internal
functions, which don't use PLT.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug driver/66737] ld: warning: -z bndplt ignored
  2015-07-02 11:10 [Bug driver/66737] New: ld: warning: -z bndplt ignored hjl.tools at gmail dot com
                   ` (2 preceding siblings ...)
  2015-07-16 14:32 ` hjl.tools at gmail dot com
@ 2015-07-16 14:43 ` ienkovich at gcc dot gnu.org
  2015-07-16 15:19 ` hjl.tools at gmail dot com
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: ienkovich at gcc dot gnu.org @ 2015-07-16 14:43 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66737

--- Comment #4 from Ilya Enkovich <ienkovich at gcc dot gnu.org> ---
OK then.  Testing this patch now:

diff --git a/gcc/config/i386/linux-common.h b/gcc/config/i386/linux-common.h
index 63dd8d8..232acea 100644
--- a/gcc/config/i386/linux-common.h
+++ b/gcc/config/i386/linux-common.h
@@ -70,9 +70,15 @@ along with GCC; see the file COPYING3.  If not see
 #endif
 #endif

+#if TARGET_64BIT_DEFAULT
+#define MPX_ARCH_64 "!m32:"
+#else
+#define MPX_ARCH_64 "m64:"
+#endif
+
 #ifndef MPX_SPEC
 #define MPX_SPEC "\
- %{mmpx:%{fcheck-pointer-bounds:%{!static:" LINK_MPX "}}}"
+ %{mmpx:%{fcheck-pointer-bounds:%{!static:%{" MPX_ARCH_64 LINK_MPX "}}}}"
 #endif

 #ifndef LIBMPX_SPEC


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug driver/66737] ld: warning: -z bndplt ignored
  2015-07-02 11:10 [Bug driver/66737] New: ld: warning: -z bndplt ignored hjl.tools at gmail dot com
                   ` (3 preceding siblings ...)
  2015-07-16 14:43 ` ienkovich at gcc dot gnu.org
@ 2015-07-16 15:19 ` hjl.tools at gmail dot com
  2015-07-22 16:25 ` ienkovich at gcc dot gnu.org
  2015-07-24 10:18 ` ienkovich at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: hjl.tools at gmail dot com @ 2015-07-16 15:19 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66737

--- Comment #7 from H.J. Lu <hjl.tools at gmail dot com> ---
(In reply to Ilya Enkovich from comment #6)
> (In reply to H.J. Lu from comment #5)
> > I don't think it is correct.  Please see SPEC_64 and SPEC_32 defined
> > in gnu-user64.h.  You should define MPX_SPEC with SPEC_64 and SPEC_32.
> 
> It should be OK since we don't support MPX for other than m32 and m64.  Will
> try with SPEC_64 also.

You should use SPEC_64, not MPX_ARCH_64 you defined, which is wrong.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug driver/66737] ld: warning: -z bndplt ignored
  2015-07-02 11:10 [Bug driver/66737] New: ld: warning: -z bndplt ignored hjl.tools at gmail dot com
                   ` (4 preceding siblings ...)
  2015-07-16 15:19 ` hjl.tools at gmail dot com
@ 2015-07-22 16:25 ` ienkovich at gcc dot gnu.org
  2015-07-24 10:18 ` ienkovich at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: ienkovich at gcc dot gnu.org @ 2015-07-22 16:25 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66737

--- Comment #8 from Ilya Enkovich <ienkovich at gcc dot gnu.org> ---
Author: ienkovich
Date: Wed Jul 22 16:24:28 2015
New Revision: 226076

URL: https://gcc.gnu.org/viewcvs?rev=226076&root=gcc&view=rev
Log:
        PR driver/66737
        * config/i386/linux-common.h (MPX_SPEC): Use linker option
        for 64bit target only.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/i386/linux-common.h


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug driver/66737] ld: warning: -z bndplt ignored
  2015-07-02 11:10 [Bug driver/66737] New: ld: warning: -z bndplt ignored hjl.tools at gmail dot com
                   ` (5 preceding siblings ...)
  2015-07-22 16:25 ` ienkovich at gcc dot gnu.org
@ 2015-07-24 10:18 ` ienkovich at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: ienkovich at gcc dot gnu.org @ 2015-07-24 10:18 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66737

Ilya Enkovich <ienkovich at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #9 from Ilya Enkovich <ienkovich at gcc dot gnu.org> ---
Fixed


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-07-24 10:18 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-02 11:10 [Bug driver/66737] New: ld: warning: -z bndplt ignored hjl.tools at gmail dot com
2015-07-16 13:05 ` [Bug driver/66737] " ienkovich at gcc dot gnu.org
2015-07-16 13:40 ` hjl.tools at gmail dot com
2015-07-16 14:32 ` hjl.tools at gmail dot com
2015-07-16 14:43 ` ienkovich at gcc dot gnu.org
2015-07-16 15:19 ` hjl.tools at gmail dot com
2015-07-22 16:25 ` ienkovich at gcc dot gnu.org
2015-07-24 10:18 ` ienkovich at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).