From: "Zuxy Meng" <zuxy.meng@gmail.com>
To: gcc-patches@gcc.gnu.org
Subject: [PATCH, mingw32] Mark ".text.unlikely" as executable
Date: Sun, 23 Mar 2008 03:54:00 -0000 [thread overview]
Message-ID: <fs4bvm$frc$2@ger.gmane.org> (raw)
[-- Attachment #1: Type: text/plain, Size: 340 bytes --]
Hi,
Unlike varasm.c config/i386/winnt.c lacks proper handling of the
".text.unlikely" section and will make it writable instead of executable.
This patch fixes PR35661. Bootstrapped and tested on i386-pc-mingw32.
PR target/35661
*config/i386/winnt.c (i386_pe_section_type_flags): Mark
".text.unlikely" as executable
--
Zuxy
[-- Attachment #2: unlikely.diff --]
[-- Type: application/octet-stream, Size: 644 bytes --]
--- gcc\config\i386\winnt.c.orig Thu Sep 13 10:17:51 2007
+++ gcc\config\i386\winnt.c Sun Mar 23 02:34:12 2008
@@ -420,6 +420,15 @@ i386_pe_section_type_flags (tree decl, c
flags = SECTION_CODE;
else if (decl && decl_readonly_section (decl, reloc))
flags = 0;
+ else if (current_function_decl
+ && cfun
+ && cfun->unlikely_text_section_name
+ && strcmp (name, cfun->unlikely_text_section_name) == 0)
+ flags = SECTION_CODE;
+ else if (!decl
+ && (!current_function_decl || !cfun)
+ && strcmp (name, UNLIKELY_EXECUTED_TEXT_SECTION_NAME) == 0)
+ flags = SECTION_CODE;
else
{
flags = SECTION_WRITE;
next reply other threads:[~2008-03-23 1:33 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-23 3:54 Zuxy Meng [this message]
2008-03-25 9:52 ` Danny Smith
2008-03-25 11:16 ` Zuxy Meng
2008-03-26 7:20 ` Danny Smith
2008-03-28 11:32 ` Zuxy Meng
2008-03-30 9:51 ` Danny Smith
2008-04-01 3:29 ` Zuxy Meng
2008-04-08 13:57 ` Zuxy
2008-05-11 22:42 ` Danny Smith
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='fs4bvm$frc$2@ger.gmane.org' \
--to=zuxy.meng@gmail.com \
--cc=gcc-patches@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).