H.J. Lu 7073b5b9ed x86-64: Check relocations with -z nocopyreloc
On x86-64, when -z nocopyreloc is used to build executable, relocations
may overflow at run-time or may not be resolved without PIC.  This patch
checks these conditions and issues an error with suggestion for -fPIC.

bfd/

	PR ld/22001
	* elf64-x86-64.c (elf_x86_64_relocate_section): Check for
	R_X86_64_PC32 relocation run-time overflow and unresolvable
	R_X86_64_32S relocation with -z nocopyreloc.

ld/

	PR ld/22001
	* testsuite/ld-i386/i386.exp: Run -z nocopyreloc tests.
	* testsuite/ld-x86-64/x86-64.exp: Likewise.
	* ld/testsuite/ld-i386/pr22001-1a.c: New file.
	* ld/testsuite/ld-i386/pr22001-1b.c: Likewise.
	* ld/testsuite/ld-i386/pr22001-1c.S: Likewise.
	* ld/testsuite/ld-x86-64/pr22001-1a.c: Likewise.
	* ld/testsuite/ld-x86-64/pr22001-1a.err: Likewise.
	* ld/testsuite/ld-x86-64/pr22001-1b.c: Likewise.
	* ld/testsuite/ld-x86-64/pr22001-1b.err: Likewise.
	* ld/testsuite/ld-x86-64/pr22001-1c.c: Likewise.
2017-08-24 06:34:38 -07:00
..
2011-07-22 20:22:38 +00:00
2012-04-03 16:01:38 +00:00
2013-11-21 04:53:05 -08:00
2013-11-21 04:53:05 -08:00
2015-10-22 04:56:39 -07:00
2015-02-19 04:45:27 -08:00
2010-07-15 00:42:23 +00:00
2011-01-03 18:16:46 +00:00
2011-01-03 18:16:46 +00:00
2014-11-13 11:09:40 -08:00
2014-11-13 11:09:40 -08:00
2012-04-03 16:01:38 +00:00
2013-08-26 22:18:07 +00:00
2013-08-26 22:18:07 +00:00
2011-01-14 23:07:11 +00:00
2012-04-03 16:01:38 +00:00
2012-04-03 16:01:38 +00:00
2016-02-26 05:01:34 -08:00
2016-02-26 05:01:34 -08:00
2016-02-26 05:01:34 -08:00
2016-02-26 05:01:34 -08:00
2016-02-26 05:01:34 -08:00
2016-02-26 05:01:34 -08:00
2016-02-26 05:01:34 -08:00
2017-05-11 11:28:16 -07:00
2017-05-11 11:28:16 -07:00
2017-05-11 11:28:16 -07:00
2017-05-11 11:28:16 -07:00
2017-06-21 14:45:57 -07:00
2010-10-01 04:47:02 +00:00
2010-10-01 04:47:02 +00:00
2017-04-03 08:08:27 -07:00
2012-04-03 16:01:38 +00:00
2016-04-20 11:13:56 -07:00
2016-04-20 11:13:56 -07:00
2015-02-19 04:45:27 -08:00
2016-04-20 11:12:22 -07:00
2014-11-20 13:29:41 -08:00
2015-10-29 09:18:57 -07:00
2012-04-03 16:01:38 +00:00
2012-04-03 16:01:38 +00:00
2012-04-03 16:01:38 +00:00
2012-05-22 18:22:03 +00:00
2012-05-22 18:22:03 +00:00
2011-05-01 13:38:22 +00:00
2011-06-24 14:03:15 +00:00
2015-04-22 23:19:59 +09:30
2015-04-01 04:24:24 -07:00
2015-04-01 04:24:24 -07:00
2016-02-02 06:36:52 -08:00
2015-10-01 09:31:16 +09:30
2015-10-28 03:20:55 -07:00
2015-10-28 03:20:55 -07:00
2016-03-13 08:57:10 -07:00
2016-03-13 08:57:10 -07:00
2016-03-13 08:57:10 -07:00
2016-02-26 05:01:34 -08:00
2016-02-26 05:01:34 -08:00
2016-04-19 20:11:55 -07:00
2016-03-15 11:47:06 -07:00
2016-03-15 11:47:06 -07:00
2016-03-15 11:47:06 -07:00
2012-04-03 16:01:38 +00:00
2012-04-03 16:01:38 +00:00
2010-09-07 17:52:32 +00:00
2010-09-07 17:52:32 +00:00
2011-01-03 18:16:46 +00:00
2012-04-03 16:01:38 +00:00
2012-04-03 16:01:38 +00:00
2012-04-03 16:01:38 +00:00
2012-04-03 16:01:38 +00:00
2012-04-03 16:01:38 +00:00
2012-04-03 16:01:38 +00:00
2013-06-28 15:07:55 +00:00
2013-07-01 16:17:11 +00:00
2009-06-19 16:00:33 +00:00
2011-03-03 22:11:33 +00:00
2009-07-23 21:22:20 +00:00
2009-07-23 21:22:20 +00:00
2012-04-03 16:01:38 +00:00
2012-04-03 16:01:38 +00:00
2010-04-07 02:41:35 +00:00
2010-04-07 02:41:35 +00:00