old-cross-binutils/ld/testsuite/ld-x86-64
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
..
32bit.s
64bit.s
abs-k1om.d
abs-l1om.d
abs.d
bnd-branch-1.d
bnd-branch-1.s
compressed1.d
compressed1.s
discarded1.d
discarded1.s
discarded1.t
dummy.s
dwarfreloc.exp
dwarfreloc.rd
dwarfreloc1.s
dwarfreloc2.s
export-class.exp
foo.s
hidden1.d
hidden1.s
hidden2.d
hidden2.s
hidden3.d
hidden3.s
ia32-1.d
ia32-2.d
ia32-3.d
ilp32-1.d
ilp32-2.d
ilp32-3.d
ilp32-4-nacl.d
ilp32-4.d
ilp32-4.s
ilp32-5.d
ilp32-5.s
ilp32-6.d
ilp32-6.s
ilp32-7.d
ilp32-7.s
ilp32-8.d
ilp32-8.s
ilp32-9.d
ilp32-9.s
ilp32-10.d
ilp32-10.s
ilp32-11.d
ilp32-11.s
incompatible.l
lea1.s
lea1a.d
lea1b.d
lea1c.d
lea1d.d
lea1e.d
lea1f.d
lea1g.d
lea1h.d
lea1i.d
lea1j.d
lea1k.d
lea1l.d
line.exp
lp64-1.d
lp64-2.d
lp64-3.d
mixed1a.s
mixed1b.s
mixed2a.s
mixed2b.s
mov1.s
mov1a.d
mov1b.d
mov1c.d
mov1d.d
mpx.exp
mpx1.out
mpx1a.c
mpx1a.rd
mpx1b.c
mpx1c.c
mpx1c.rd
mpx2.out
mpx2a.c
mpx2a.rd
mpx2b.c
mpx2c.c
mpx2c.rd
nogot1.d
nogot1.s
nogot2.d
nogot2.s
pcrel8.d
pcrel16.d
plt-nacl.pd
plt-pic.s
plt.pd
plt.s
pltlib.s
pr12570a.d
pr12570a.s
pr12570b.d
pr12570b.s
pr12718.d
pr12718.s
pr12921.d
pr12921.s
pr13082-1.s
pr13082-1a.d
pr13082-1b.d
pr13082-2.s
pr13082-2a.d
pr13082-2b.d
pr13082-3.s
pr13082-3a.d
pr13082-3b.d
pr13082-4.s
pr13082-4a.d
pr13082-4b.d
pr13082-5.s
pr13082-5a.d
pr13082-5b.d
pr13082-6.s
pr13082-6a.d
pr13082-6b.d
pr13947.d
pr13947.s
pr14207.d Adjust LOAD segment to generate GNU_RELRO segment 2014-01-08 05:57:21 -08:00
pr14207.s
pr14215.d
pr14215.s
protected1.d
protected1.s
protected2-k1om.d
protected2-l1om.d
protected2.d
protected2.s
protected3-k1om.d
protected3-l1om.d
protected3.d
protected3.s
protected4.d
protected4.s
protected5.d
protected5.s
simple.c
split-by-file-nacl.rd
split-by-file.rd
split-by-file1.s
split-by-file2.s
start.s
tlsbin-nacl.rd
tlsbin.dd
tlsbin.rd
tlsbin.s
tlsbin.sd
tlsbin.td
tlsbindesc-nacl.rd
tlsbindesc.dd
tlsbindesc.rd
tlsbindesc.s
tlsbindesc.sd
tlsbindesc.td
tlsbinpic.s
tlsdesc-nacl.pd
tlsdesc-nacl.rd
tlsdesc.dd
tlsdesc.pd
tlsdesc.rd
tlsdesc.s
tlsdesc.sd
tlsdesc.td
tlsg.s
tlsg.sd
tlsgd1.dd
tlsgd1.s
tlsgd2.d
tlsgd2.s
tlsgd3.d
tlsgd3.s
tlsgd4.dd
tlsgd4.s
tlsgd5.dd
tlsgd5a.s
tlsgd5b.s
tlsgd6.dd
tlsgd6a.s
tlsgd6b.s
tlsgd7.dd
tlsgd7.s
tlsgd8.dd
tlsgd8.s
tlsgdesc-nacl.rd
tlsgdesc.dd
tlsgdesc.rd
tlsgdesc.s
tlsie1.dd
tlsie1.s
tlsie2.d
tlsie2.s
tlsie3.d
tlsie3.s
tlsie4.dd
tlsie4.s
tlsld1.dd
tlsld1.s
tlsld2.dd
tlsld2.s
tlsld3.dd
tlsld3.s
tlsle1.d
tlsle1.s
tlslib.s
tlspic-nacl.rd
tlspic.dd
tlspic.rd
tlspic.sd
tlspic.td
tlspic1.s
tlspic2.s
tlspie1.d
tlspie1.s
undefined.s
unique1.d
unique1.s
x86-64-64-export-class.rd
x86-64-x32-export-class.rd
x86-64-x32.rd
x86-64.exp