old-cross-binutils/ld/testsuite
H.J. Lu 43a8475ca0 Adjust LOAD segment to generate GNU_RELRO segment
This patch fixes 2 GNU_RELRO segment bugs:

1. lang_size_sections didn't properly align base to the maximum
alignment power of sections between DATA_SEGMENT_ALIGN and
DATA_SEGMENT_RELRO_END.
2. ld failed to adjust LOAD segment to generate GNU_RELRO segment
when LOAD segment doesn't fit GNU_RELRO segment.  This is

https://sourceware.org/bugzilla/show_bug.cgi?id=14207

We "fixed" ld by not generating GNU_RELRO segment.  This patch
adjusts LOAD segment to generate GNU_RELRO segment.  It fixes
PR ld/16322 and at the same time it also fixes PR binutils/16323
since now we can adjust LOAD segment if it is too small.

bfd/

	PR ld/14207
	PR ld/16322
	PR binutils/16323
	* elf.c (_bfd_elf_map_sections_to_segments): Don't check section
	size for PT_GNU_RELRO segment.
	(assign_file_positions_for_load_sections): If PT_LOAD segment
	doesn't fit PT_GNU_RELRO segment, adjust its p_filesz and p_memsz.

ld/

	PR ld/14207
	PR ld/16322
	PR binutils/16323
	* ldlang.c (lang_size_sections): Properly align RELRO base.

ld/testsuite/

	PR ld/14207
	PR ld/16322
	PR binutils/16323
	* ld-elf/pr16322.d: New file.
	* ld-elf/pr16322.s: Likewise.

	* ld-x86-64/pr14207.d: Expect PT_GNU_RELRO segment.
2014-01-08 05:57:21 -08:00
..
config Add HOSTING_SLIBS and use it for -pie 2013-11-26 11:17:08 -08:00
ld-aarch64 ld/testsuite/ld-aarch64: Fixup IFUNC tests to work on all targets 2013-12-11 21:05:36 +00:00
ld-alpha
ld-arm ld/ARM: Fix script-type testsuite failure. 2013-11-14 08:39:59 +00:00
ld-auto-import
ld-bootstrap
ld-cdtest
ld-checks
ld-cris ld/ELF: refine fake STT_FILE symbol emission 2013-10-29 17:52:24 +01:00
ld-crx
ld-cygwin
ld-d10v
ld-discard
ld-elf Adjust LOAD segment to generate GNU_RELRO segment 2014-01-08 05:57:21 -08:00
ld-elfcomm
ld-elfvers Allow for extra st_other readelf output in ld testsuite 2013-11-04 10:18:47 +10:30
ld-elfvsb
ld-elfweak
ld-fastcall
ld-frv
ld-gc * archures.c: Add some more MSP430 machine numbers. 2013-05-02 21:06:15 +00:00
ld-h8300
ld-i386 Update x86 nacl tests for section alignment change 2013-06-04 16:08:51 +00:00
ld-ia64 Pass ignored unresolved relocations to ld backend 2013-11-05 10:29:44 -08:00
ld-ifunc Allow for extra st_other readelf output in ld testsuite 2013-11-04 10:18:47 +10:30
ld-libs
ld-linkonce
ld-m68hc11
ld-m68k
ld-mep
ld-metag
ld-mips-elf binutils/testsuite/ 2013-11-27 09:11:06 +00:00
ld-misc
ld-mmix ld/ELF: refine fake STT_FILE symbol emission 2013-10-29 17:52:24 +01:00
ld-mn10300
ld-nds32 Add support for Andes NDS32: 2013-12-13 11:52:32 +00:00
ld-nios2
ld-pe strip off +x bits on non-executable/script files 2013-12-07 02:03:03 -05:00
ld-pie Set ET_EXEC for -pie -Ttext-segment= 2013-12-12 07:41:27 -08:00
ld-plugin [ld/testsuite/] 2013-11-27 13:43:39 +00:00
ld-powerpc Edit ELFv2 global entry prologue to non-PIC 2013-11-04 10:21:32 +10:30
ld-s390 2013-07-05 Andreas Krebbel <Andreas.Krebbel@de.ibm.com> 2013-07-05 09:51:00 +00:00
ld-scripts ld crossref test fix 2013-11-04 10:17:55 +10:30
ld-selective
ld-sh ld/ELF: refine fake STT_FILE symbol emission 2013-10-29 17:52:24 +01:00
ld-shared
ld-size ld/testsuite/ 2013-06-04 19:24:10 +00:00
ld-sparc
ld-spu
ld-srec * archures.c: Add some more MSP430 machine numbers. 2013-05-02 21:06:15 +00:00
ld-tic6x
ld-tilegx
ld-tilepro
ld-undefined * archures.c: Add some more MSP430 machine numbers. 2013-05-02 21:06:15 +00:00
ld-unique
ld-v850
ld-vax-elf * ld-vax-elf/export-class-call.dd: New test. 2013-07-27 22:28:29 +00:00
ld-versados
ld-vxworks
ld-x86-64 Adjust LOAD segment to generate GNU_RELRO segment 2014-01-08 05:57:21 -08:00
ld-xc16x
ld-xstormy16
ld-xtensa
lib ld/testsuite 2013-12-18 15:16:41 +00:00
ChangeLog Adjust LOAD segment to generate GNU_RELRO segment 2014-01-08 05:57:21 -08:00
ChangeLog-2004
ChangeLog-2005
ChangeLog-2006
ChangeLog-2007
ChangeLog-2008
ChangeLog-2009
ChangeLog-2010
ChangeLog-2011
ChangeLog-2012
ChangeLog-2013 New Year - binutils ChangeLog rotation 2014-01-08 05:32:12 -08:00
ChangeLog-9303