Go to file
Sandra Loosemore 2d33dcfe9f nios2: Support for GOT-relative DW_EH_PE_datarel encoding.
On nios2-linux-gnu, there has been a long-standing bug in C++ exception
handling that sometimes resulted in link errors like

../nios2-linux-gnu/bin/ld: FDE encoding in /tmp/cccfpQ2l.o(.eh_frame) prevents .eh_frame_hdr table being created

when building some shared libraries or PIE executables.  The root of
the problem is that GCC was incorrectly emitting an absolute encoding
in EH tables for PIC.  This patch changes it to use either
DW_EH_PE_indirect (for global) or DW_EH_PE_datarel (for local), and
fixes libgcc so it can find the address of the GOT as the base address
for DW_EH_PE_datarel.

Complicating matters somewhat, GAS was missing support for
%gotoff(symbol) relocation syntax.  I have just pushed a fix for that,
but I've added a configure check to test for presence of the binutils
support and fall back to the current absolute encoding (which works
most of the time) if it is not available.  Once the fix makes it into
an official binutils release it might be appropriate to make this
error out instead.

Since this is a wrong-code bug and affects only nios2 target, I think
this is appropriate for Stage 4.  I regression-tested on both
nios2-linux-gnu and nios2-elf, with and without the binutils support
present, before committing this.

2020-01-31  Sandra Loosemore  <sandra@codesourcery.com>

	gcc/
	* configure.ac [nios2-*-*]: Check HAVE_AS_NIOS2_GOTOFF_RELOCATION.
	* config.in: Regenerated.
	* configure: Regenerated.
	* config/nios2/nios2.h (ASM_PREFERRED_EH_DATA_FORMAT): Fix handling
	for PIC when HAVE_AS_NIOS2_GOTOFF_RELOCATION.
	(ASM_MAYBE_OUTPUT_ENCODED_ADDR_RTX): New.

	gcc/testsuite/
	* g++.target/nios2/hello-pie.C: New.
	* g++.target/nios2/nios2.exp: New.

	libgcc/
	* config.host [nios2-*-linux*] (tmake_file, tm_file): Adjust.
	* config/nios2-elf-lib.h: New.
	* unwind-dw2-fde-dip.c (_Unwind_IteratePhdrCallback): Use existing
	code for finding GOT base for nios2.
2020-01-31 16:46:50 -08:00
INSTALL
config Fixes after recent configure changes relating to static libraries 2020-02-01 00:34:28 +00:00
contrib contrib: Change 'remote' for personal branches and add branch creation script 2020-01-24 14:38:16 +00:00
fixincludes Fix missing SCNuMAX defines in inttypes.h on hpux11.[01]* 2020-01-25 12:20:24 -05:00
gcc nios2: Support for GOT-relative DW_EH_PE_datarel encoding. 2020-01-31 16:46:50 -08:00
gnattools PR81878: fix --disable-bootstrap --enable-languages=ada 2018-11-20 00:07:47 +00:00
gotools libgo: update to Go1.14beta1 2020-01-21 23:53:22 -08:00
include OpenACC 'acc_get_property' cleanup 2020-01-10 23:24:36 +01:00
intl Fixes after recent configure changes relating to static libraries 2020-02-01 00:34:28 +00:00
libada Add `--with-toolexeclibdir=' configuration option 2020-01-24 11:24:25 +00:00
libatomic Add `--with-toolexeclibdir=' configuration option 2020-01-24 11:24:25 +00:00
libbacktrace Update copyright years. 2020-01-01 12:51:42 +01:00
libcc1 init.c (build_new): Add location_t parameter and use it throughout. 2020-01-07 17:58:18 +00:00
libcpp Fixes after recent configure changes relating to static libraries 2020-02-01 00:34:28 +00:00
libdecnumber Update copyright years. 2020-01-01 12:51:42 +01:00
libffi Add `--with-toolexeclibdir=' configuration option 2020-01-24 11:24:25 +00:00
libgcc nios2: Support for GOT-relative DW_EH_PE_datarel encoding. 2020-01-31 16:46:50 -08:00
libgfortran Add `--with-toolexeclibdir=' configuration option 2020-01-24 11:24:25 +00:00
libgo runtime, syscall: add a couple of hurd build tags 2020-01-29 16:43:57 -08:00
libgomp [amdgcn] Scale number of threads/workers with VGPR usage 2020-01-31 07:13:05 -08:00
libhsail-rt Add `--with-toolexeclibdir=' configuration option 2020-01-24 11:24:25 +00:00
libiberty [libiberty] output empty args as a pair of quotes 2020-01-23 16:45:24 -03:00
libitm Add `--with-toolexeclibdir=' configuration option 2020-01-24 11:24:25 +00:00
libobjc Add `--with-toolexeclibdir=' configuration option 2020-01-24 11:24:25 +00:00
liboffloadmic Add `--with-toolexeclibdir=' configuration option 2020-01-24 11:24:25 +00:00
libphobos Add `--with-toolexeclibdir=' configuration option 2020-01-24 11:24:25 +00:00
libquadmath Add `--with-toolexeclibdir=' configuration option 2020-01-24 11:24:25 +00:00
libsanitizer Add `--with-toolexeclibdir=' configuration option 2020-01-24 11:24:25 +00:00
libssp Add `--with-toolexeclibdir=' configuration option 2020-01-24 11:24:25 +00:00
libstdc++-v3 Fixes after recent configure changes relating to static libraries 2020-02-01 00:34:28 +00:00
libvtv Add `--with-toolexeclibdir=' configuration option 2020-01-24 11:24:25 +00:00
lto-plugin Update copyright years. 2020-01-01 12:51:42 +01:00
maintainer-scripts Replace update_web_docs_libstdcxx_svn with update_web_docs_libstdcxx_git 2020-01-13 21:40:44 +00:00
zlib Add `--with-toolexeclibdir=' configuration option 2020-01-24 11:24:25 +00:00
.dir-locals.el
.gitattributes Add *.md diff=md. 2020-01-15 14:29:53 +01:00
.gitignore Add .clangd and compile_commands.json to .gitignore. 2019-08-28 19:33:28 +00:00
ABOUT-NLS
COPYING
COPYING.LIB
COPYING.RUNTIME
COPYING3
COPYING3.LIB
ChangeLog Add *.md diff=md. 2020-01-15 14:29:53 +01:00
ChangeLog.jit
ChangeLog.tree-ssa
MAINTAINERS MAINTAINERS: Update my email address. 2020-01-13 22:10:14 +03:00
Makefile.def Sync top-level change from gdb 2019-06-15 21:32:03 +00:00
Makefile.in Makefile.tpl (HOST_EXPORTS): Add CXX_FOR_BUILD. 2019-08-23 15:37:22 -06:00
Makefile.tpl Makefile.tpl (HOST_EXPORTS): Add CXX_FOR_BUILD. 2019-08-23 15:37:22 -06:00
README
ar-lib Update GCC to autoconf 2.69, automake 1.15.1 (PR bootstrap/82856). 2018-10-31 17:03:16 +00:00
compile
config-ml.in MSP430: Add -fno-exceptions multilib 2019-12-11 19:19:50 +00:00
config.guess Update config.sub and config.guess. 2019-09-09 11:14:32 +02:00
config.rpath
config.sub Update config.sub and config.guess. 2019-09-09 11:14:32 +02:00
configure configure.ac: Factor out common cases for compare_exclusions. 2019-12-11 20:59:35 +00:00
configure.ac configure.ac: Factor out common cases for compare_exclusions. 2019-12-11 20:59:35 +00:00
depcomp
install-sh
libtool-ldflags
libtool.m4 [ARM/FDPIC v6 02/24] [ARM] FDPIC: Handle arm*-*-uclinuxfdpiceabi in configure scripts 2019-09-10 09:37:00 +02:00
ltgcc.m4
ltmain.sh
ltoptions.m4
ltsugar.m4
ltversion.m4
lt~obsolete.m4
missing
mkdep
mkinstalldirs
move-if-change
multilib.am Update GCC to autoconf 2.69, automake 1.15.1 (PR bootstrap/82856). 2018-10-31 17:03:16 +00:00
symlink-tree
test-driver Update GCC to autoconf 2.69, automake 1.15.1 (PR bootstrap/82856). 2018-10-31 17:03:16 +00:00
ylwrap

README

This directory contains the GNU Compiler Collection (GCC).

The GNU Compiler Collection is free software.  See the files whose
names start with COPYING for copying permission.  The manuals, and
some of the runtime libraries, are under different terms; see the
individual source files for details.

The directory INSTALL contains copies of the installation information
as HTML and plain text.  The source of this information is
gcc/doc/install.texi.  The installation information includes details
of what is included in the GCC sources and what files GCC installs.

See the file gcc/doc/gcc.texi (together with other files that it
includes) for usage and porting information.  An online readable
version of the manual is in the files gcc/doc/gcc.info*.

See http://gcc.gnu.org/bugs/ for how to report bugs usefully.

Copyright years on GCC source files may be listed using range
notation, e.g., 1987-2012, indicating that every year in the range,
inclusive, is a copyrightable year that could otherwise be listed
individually.