This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: c++/4356: Exception handling does not work at all for NetBSD/i386ELF target
- To: <olgerd at pobox dot com>
- Subject: Re: c++/4356: Exception handling does not work at all for NetBSD/i386ELF target
- From: Krister Walfridsson <cato at df dot lth dot se>
- Date: Mon, 15 Oct 2001 23:25:45 +0200 (MEST)
- cc: <gcc-gnats at gcc dot gnu dot org>, <nobody at gcc dot gnu dot org>, <gcc-prs at gcc dot gnu dot org>, <gcc-bugs at gcc dot gnu dot org>, <gcc-patches at gcc dot gnu dot org>
The PR c++/4356 reports that programs dumps core every time an exception is
thrown. This is because the config file netbsd-elf.h forgets some definitions
that are necessary for PIC code. This is solved by the patch below.
Bootstrapped and tested on i386-unknown-netbsdelf1.5Y.
/Krister
2001-10-15 Krister Walfridsson <cato@df.lth.se>
* config/i386/netbsd-elf.h (ASM_OUTPUT_ADDR_DIFF_ELT): Define.
(JUMP_TABLES_IN_TEXT_SECTION): Define.
Index: netbsd-elf.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/netbsd-elf.h,v
retrieving revision 1.2
diff -c -3 -p -r1.2 netbsd-elf.h
*** netbsd-elf.h 2001/10/09 10:16:12 1.2
--- netbsd-elf.h 2001/10/15 21:05:32
*************** Boston, MA 02111-1307, USA. */
*** 168,173 ****
--- 168,183 ----
}
#endif
+ /* This is how to output an element of a case-vector that is relative.
+ This is only used for PIC code. */
+ #undef ASM_OUTPUT_ADDR_DIFF_ELT
+ #define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \
+ fprintf ((FILE), "\t.long _GLOBAL_OFFSET_TABLE_+[.-%s%d]\n", LPREFIX, VALUE)
+
+ /* Indicate that jump tables go in the text section. This is
+ necessary when compiling PIC code. */
+ #define JUMP_TABLES_IN_TEXT_SECTION (flag_pic)
+
/*
* We always use gas here, so we don't worry about ECOFF assembler problems.
*/