+2010-08-13 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR ld/11913
+ * elf32-i386.c (elf_i386_finish_dynamic_sections): Check if
+ .got.plt section is discarded.
+ * elf64-x86-64.c (elf64_x86_64_finish_dynamic_sections): Likewise.
+
2010-08-13 Nathan Sidwell <nathan@codesourcery.com>
* elf32-m69k.c (elf32_m68k_print_private_bfd_data): Detect EMAC_B
if (htab->elf.sgotplt)
{
+ if (bfd_is_abs_section (htab->elf.sgotplt->output_section))
+ {
+ (*_bfd_error_handler)
+ (_("discarded output section: `%A'"), htab->elf.sgotplt);
+ return FALSE;
+ }
+
/* Fill in the first three entries in the global offset table. */
if (htab->elf.sgotplt->size > 0)
{
if (htab->elf.sgotplt)
{
+ if (bfd_is_abs_section (htab->elf.sgotplt->output_section))
+ {
+ (*_bfd_error_handler)
+ (_("discarded output section: `%A'"), htab->elf.sgotplt);
+ return FALSE;
+ }
+
/* Fill in the first three entries in the global offset table. */
if (htab->elf.sgotplt->size > 0)
{
+2010-08-13 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR ld/11913
+ * ld-i386/discarded1.d: New.
+ * ld-i386/discarded1.s: Likewise.
+ * ld-i386/discarded1.t: Likewise.
+ * ld-x86-64/discarded1.d: Likewise.
+ * ld-x86-64/discarded1.s: Likewise.
+ * ld-x86-64/discarded1.t: Likewise.
+
+ * ld-i386/i386.exp: Run discarded1.
+ * ld-x86-64/x86-64.exp: Likewise.
+
2010-08-09 Catherine Moore <clm@codesourcery.com>
* ld-mips-elf/mode-change-error-1.d: New.
--- /dev/null
+#as: --32
+#ld: -melf_i386 -T discarded1.t
+#error: .*discarded output section: `.got.plt'
--- /dev/null
+ .text
+.globl _start
+ .type _start, @function
+_start:
+ movl x@GOT(%ecx), %eax
+ .size _start, .-_start
+.globl x
+ .data
+ .align 4
+ .type x, @object
+ .size x, 4
+x:
+ .long 2
--- /dev/null
+ENTRY(_start)
+SECTIONS
+{
+ .text : {*(.text)}
+ .data : {*(.data)}
+ /DISCARD/ : {*(*)}
+}
run_dump_test "protected3"
run_dump_test "tlspie1"
run_dump_test "nogot1"
+run_dump_test "discarded1"
if { !([istarget "i?86-*-linux*"]
|| [istarget "x86_64-*-linux*"]) } {
--- /dev/null
+#as: --64
+#ld: -melf_x86_64 -T discarded1.t
+#error: .*discarded output section: `.got.plt'
--- /dev/null
+ .text
+.globl _start
+ .type _start, @function
+_start:
+ movq x@GOTPCREL(%rip), %rax
+ .size _start, .-_start
+.globl x
+ .data
+ .align 4
+ .type x, @object
+ .size x, 4
+x:
+ .long 2
--- /dev/null
+ENTRY(_start)
+SECTIONS
+{
+ .text : {*(.text)}
+ .data : {*(.data)}
+ /DISCARD/ : {*(*)}
+}
run_dump_test "tlspie1"
run_dump_test "unique1"
run_dump_test "nogot1"
+run_dump_test "discarded1"
if { ![istarget "x86_64-*-linux*"] } {
return