From: stefan Date: Wed, 31 May 2017 03:24:20 +0000 (+0000) Subject: Make gcc move switch tables into .rodata instead of .text on i386/amd64 X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=a7e293634bed787cebebfe65a74ec3cb6e3385bb;p=openbsd Make gcc move switch tables into .rodata instead of .text on i386/amd64 For C++, gcc has to make use of comdat sections instead of .gnu.linkonce sections for this because switch tables and functions would now end up in different .gnu.linkonce sections. This can cause ld to sometimes incorrectly discard the switch tables, which causes linker errors. With comdat sections, making the switch table and function sections belong together is more reliable. ok deraadt@ --- diff --git a/gnu/gcc/gcc/config/i386/openbsd64.h b/gnu/gcc/gcc/config/i386/openbsd64.h index 5a5584bd588..24444e505e0 100644 --- a/gnu/gcc/gcc/config/i386/openbsd64.h +++ b/gnu/gcc/gcc/config/i386/openbsd64.h @@ -126,4 +126,4 @@ Boston, MA 02111-1307, USA. */ #define OBSD_HAS_CORRECT_SPECS #undef JUMP_TABLES_IN_TEXT_SECTION -#define JUMP_TABLES_IN_TEXT_SECTION (flag_pic) +#define JUMP_TABLES_IN_TEXT_SECTION 0 diff --git a/gnu/usr.bin/cc/cc_tools/auto-host.h b/gnu/usr.bin/cc/cc_tools/auto-host.h index 532db8d4bac..a37fafc1675 100644 --- a/gnu/usr.bin/cc/cc_tools/auto-host.h +++ b/gnu/usr.bin/cc/cc_tools/auto-host.h @@ -1,6 +1,6 @@ /* auto-host.h. enerated b configure. */ /* config.in. Generated from configure.ac by autoheader. */ -/* $OpenBSD: auto-host.h,v 1.6 2015/08/23 15:33:18 kettenis Exp $ */ +/* $OpenBSD: auto-host.h,v 1.7 2017/05/31 03:24:20 stefan Exp $ */ /* Define as the number of bits in a byte, if \`limits.h' doesn't. */ #ifndef USED_FOR_TARGET @@ -181,7 +181,7 @@ /* Define true if the assembler supports '.long foo@GOTOFF'. */ #ifndef USED_FOR_TARGET -#define HAVE_AS_GOTOFF_IN_DATA 0 +#define HAVE_AS_GOTOFF_IN_DATA 1 #endif @@ -315,7 +315,7 @@ /* Define 0/1 if your assembler and linker support COMDAT groups. */ #ifndef USED_FOR_TARGET -#define HAVE_COMDAT_GROUP 0 +#define HAVE_COMDAT_GROUP 1 #endif