public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "i at maskray dot me" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/110729] New: -fpatchable-function-entries: __patchable_function_entries has wrong sh_link Date: Wed, 19 Jul 2023 06:20:39 +0000 [thread overview] Message-ID: <bug-110729-4@http.gcc.gnu.org/bugzilla/> (raw) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110729 Bug ID: 110729 Summary: -fpatchable-function-entries: __patchable_function_entries has wrong sh_link Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: middle-end Assignee: unassigned at gcc dot gnu.org Reporter: i at maskray dot me Target Milestone: --- Noticed by Ziwei Mao. % cat a.c void f() {} void g() {} void h() {} % gcc -ffunction-sections -fpatchable-function-entry=2 -c a.c % gcc -ffunction-sections -fpatchable-function-entry=2 -S a.c a.o has .text.f, .text.g, and .text.h, but just one __patchable_function_entries section. % grep __patchable_function_entries a.s .section __patchable_function_entries,"awo",@progbits,f .section __patchable_function_entries,"awo",@progbits,f .section __patchable_function_entries,"awo",@progbits,f I think the second and the third __patchable_function_entries should reference g and h, respectively. Otherwise, if f is discarded by ld --gc-sections, the whole __patchable_function_entries (also used by g and h) will be discarded. (Also, if g is discarded, its __patchable_function_entries fragment may be retained if f is retained.)
next reply other threads:[~2023-07-19 6:20 UTC|newest] Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-07-19 6:20 i at maskray dot me [this message] 2023-07-19 6:24 ` [Bug middle-end/110729] " pinskia at gcc dot gnu.org 2023-07-19 6:26 ` pinskia at gcc dot gnu.org 2023-07-19 6:27 ` pinskia at gcc dot gnu.org 2023-07-19 6:28 ` pinskia at gcc dot gnu.org 2023-07-21 5:18 ` cvs-commit at gcc dot gnu.org 2023-07-21 5:49 ` linkw 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-110729-4@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: linkBe 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).