+2014-12-23 Alan Modra <amodra@gmail.com>
+
+ * elflink.c (_bfd_elf_define_linkage_sym): Set linker_def.
+ * linker.c (_bfd_generic_link_add_one_symbol): Clear linker_def
+ for CDEF, DEF, DEFW, COM.
+
2014-12-22 Nick Clifton <nickc@redhat.com>
PR binutils/17512
h = (struct elf_link_hash_entry *) bh;
h->def_regular = 1;
h->non_elf = 0;
+ h->root.linker_def = 1;
h->type = STT_OBJECT;
if (ELF_ST_VISIBILITY (h->other) != STV_INTERNAL)
h->other = (h->other & ~ELF_ST_VISIBILITY (-1)) | STV_HIDDEN;
h->type = bfd_link_hash_defined;
h->u.def.section = section;
h->u.def.value = value;
+ h->linker_def = 0;
/* If we have been asked to, we act like collect2 and
identify all functions that might be global
}
else
h->u.c.p->section = section;
+ h->linker_def = 0;
break;
case REF:
+2014-12-23 Alan Modra <amodra@gmail.com>
+
+ * bfdlink.h (struct bfd_link_hash_entry): Comment non_ir_ref. Add
+ linker_def.
+
2014-12-12 Phil Muldoon <pmuldoon@redhat.com>
Jan Kratochvil <jan.kratochvil@redhat.com>
Tom Tromey <tromey@redhat.com>
/* Type of this entry. */
ENUM_BITFIELD (bfd_link_hash_type) type : 8;
+ /* Symbol is referenced in a normal object file, as distict from a LTO
+ IR object file. */
unsigned int non_ir_ref : 1;
+ /* Symbol is a built-in define. These will be overridden by PROVIDE
+ in a linker script. */
+ unsigned int linker_def : 1;
+
/* A union of information depending upon the type. */
union
{
+2014-12-23 Alan Modra <amodra@gmail.com>
+
+ * ldexp.c (exp_fold_tree_1 <etree_provide>): Test linker_def.
+
2014-12-23 Alan Modra <amodra@gmail.com>
* ldexp.c (exp_fold_tree_1 <etree_provide>): Leave bfd_link_hash_common
if (h == NULL
|| !(h->type == bfd_link_hash_new
|| h->type == bfd_link_hash_undefined
- || (h->type == bfd_link_hash_defined
- && (h->u.def.section->flags
- & SEC_LINKER_CREATED) != 0)))
+ || h->linker_def))
{
/* Do nothing. The symbol was never referenced, or
was defined in some object file. Undefined weak
+2014-12-23 Alan Modra <amodra@gmail.com>
+
+ * ld-powerpc/sdabase.s,
+ * ld-powerpc/sdabase.t,
+ * ld-powerpc/sdabase.d: New test.
+ * ld-powerpc/sdabase2.t,
+ * ld-powerpc/sdabase2.d: New test.
+ * ld-powerpc/powerpc.exp: Run them.
+
2014-12-23 Alan Modra <amodra@gmail.com>
* ld-elf/endsym.s, *ld-elf/endsym.d: New test.
}
run_dump_test "plt1"
+run_dump_test "sdabase"
+run_dump_test "sdabase2"
run_dump_test "attr-gnu-4-00"
run_dump_test "attr-gnu-4-01"
--- /dev/null
+#source: sdabase.s
+#as: -a32
+#ld: -melf32ppc -T sdabase.t
+#objdump: -s
+#target: powerpc*-*-*
+
+.*: file format .*
+
+Contents of section \.sdata:
+ 0400 (00008400|00840000) (00000400|00040000) .*
--- /dev/null
+ .text
+ .globl _start
+_start:
+
+ .section .sdata,"aw",@progbits
+ .globl my_sdata
+my_sdata:
+ .dc.a _SDA_BASE_
+ .dc.a my_sdata
--- /dev/null
+SECTIONS
+{
+ .text 0x100 : { *(.text) }
+ .sdata 0x400 : { *(.sdata) }
+ /DISCARD/ : { *(*) }
+}
--- /dev/null
+#source: sdabase.s
+#as: -a32
+#ld: -melf32ppc -T sdabase2.t
+#objdump: -s
+#target: powerpc*-*-*
+
+.*: file format .*
+
+Contents of section \.sdata:
+ 0400 (00000400|00040000) (00000400|00040000) .*
--- /dev/null
+SECTIONS
+{
+ .text 0x100 : { *(.text) }
+ .sdata 0x400 : { PROVIDE (_SDA_BASE_ = .); *(.sdata) }
+ /DISCARD/ : { *(*) }
+}