public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH, mingw32] Mark ".text.unlikely" as executable
@ 2008-03-23  3:54 Zuxy Meng
  2008-03-25  9:52 ` Danny Smith
  0 siblings, 1 reply; 9+ messages in thread
From: Zuxy Meng @ 2008-03-23  3:54 UTC (permalink / raw)
  To: gcc-patches

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

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

end of thread, other threads:[~2008-05-11 21:09 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-23  3:54 [PATCH, mingw32] Mark ".text.unlikely" as executable Zuxy Meng
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

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