public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "marxin at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/105169] Compiling C++ code with -fpatchable-function-entry=16,14 results in references to discarded sections
Date: Wed, 06 Apr 2022 09:29:51 +0000	[thread overview]
Message-ID: <bug-105169-4-FNsJEWmerV@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-105169-4@http.gcc.gnu.org/bugzilla/>

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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |marxin at gcc dot gnu.org

--- Comment #2 from Martin Liška <marxin at gcc dot gnu.org> ---
Confirmed, a bit reduced test-case:

$ cat 1.ii
struct WinsockInterfaceClass {
  virtual int Get_Protocol() { return 0; }
} PacketTransport;

$ cat 2.ii
struct WinsockInterfaceClass {
  WinsockInterfaceClass();
  virtual void Set_Broadcast_Address() {}
  virtual int Get_Protocol() { return 0; }
};
WinsockInterfaceClass::WinsockInterfaceClass() {}

int main()
{
  return 0;
}

$ g++ 1.ii 2.ii -fpatchable-function-entry=1 -O2
`.text._ZN21WinsockInterfaceClass12Get_ProtocolEv' referenced in section
`__patchable_function_entries' of /tmp/cc6P6bkZ.o: defined in discarded section
`.text._ZN21WinsockInterfaceClass12Get_ProtocolEv[_ZN21WinsockInterfaceClass12Get_ProtocolEv]'
of /tmp/cc6P6bkZ.o
collect2: error: ld returned 1 exit status

$ g++ 1.ii 2.ii -fpatchable-function-entry=1 -O2 -fuse-ld=gold
/tmp/ccCrCzcR.o(__patchable_function_entries+0x8): error: relocation refers to
local symbol "" [4], which is defined in a discarded section
  section group signature: "_ZN21WinsockInterfaceClass12Get_ProtocolEv"
  prevailing definition is from /tmp/ccH1NIH4.o
collect2: error: ld returned 1 exit status

  parent reply	other threads:[~2022-04-06  9:29 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-05 17:07 [Bug c++/105169] New: " giuliano.belinassi at gmail dot com
2022-04-06  8:08 ` [Bug c++/105169] " rguenth at gcc dot gnu.org
2022-04-06  9:29 ` marxin at gcc dot gnu.org [this message]
2022-04-06  9:40 ` marxin at gcc dot gnu.org
2022-04-06  9:53 ` rguenth at gcc dot gnu.org
2022-04-06 11:31 ` marxin at gcc dot gnu.org
2022-04-06 11:35 ` rguenther at suse dot de
2022-04-06 11:46 ` marxin at gcc dot gnu.org
2022-04-07 16:05 ` matz at gcc dot gnu.org
2022-04-08 12:11 ` marxin at gcc dot gnu.org
2022-04-08 12:23 ` rguenth at gcc dot gnu.org
2022-04-08 12:29 ` rguenth at gcc dot gnu.org
2022-04-08 12:33 ` rguenth at gcc dot gnu.org
2022-05-17 17:34 ` cvs-commit at gcc dot gnu.org
2023-07-19  6:26 ` [Bug middle-end/105169] " pinskia at gcc dot gnu.org
2023-07-19  6:26 ` pinskia at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-105169-4-FNsJEWmerV@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).