public inbox for archer-commits@sourceware.org
help / color / mirror / Atom feed
From: jkratoch@sourceware.org
To: archer-commits@sourceware.org
Subject: [SCM]  archer-jankratochvil-vla: Merge commit 'origin/master' into archer-jankratochvil-vla
Date: Thu, 27 Nov 2008 15:52:00 -0000	[thread overview]
Message-ID: <20081127155229.21282.qmail@sourceware.org> (raw)

The branch, archer-jankratochvil-vla has been updated
       via  9e26525dc904c6d7a01fad44348e590776aaa391 (commit)
       via  eacfc7f379ab26e2b6b90cedcc4f351c367c5e32 (commit)
       via  2dc2ab7195603cb23108c9b4c44723284ff1802c (commit)
       via  a5a9fbec4743662b1827243dfd148770e2824cbc (commit)
       via  838d298a3a1b129432e84ab6cc4f7d9126efbf49 (commit)
       via  ecb1a44d46adda84e55b1a1df2a5f64c1189fb92 (commit)
       via  ba37a8fd83ed2f97e4d70b6157be89361bfe2800 (commit)
       via  5ddc3bdd890c7c6f22f780b2dd3a914acebc10cd (commit)
       via  04fd1fef7ca80e6e3b8c583d45db859c79f338dd (commit)
       via  5bfd830eca48376f3bbed9dd67f8a4373fc763ee (commit)
       via  6cae91d12d01bec18e555e8e42f52599e5801d2b (commit)
       via  b81fd623498d67e7f34679e1f1aabf41a82f8215 (commit)
       via  9cd2307aff9fc1ec8eef77b1082e5465efba9681 (commit)
       via  03b9244867f12755de6e9375fae71fbca961ca2e (commit)
       via  1039b423b1787c2756424723c48ae64b8b68edfd (commit)
       via  25a20a8ef8cfd5b2e59f00d1270505d177ec66cc (commit)
       via  ba2590188462aa4e3905ab2b7591b02f8bd8a3ae (commit)
       via  1093efdbfda9470f9a13ca967a048a74660f8937 (commit)
       via  750a0b747219887bdba2baf9408be684fb43fb44 (commit)
       via  e4fcc82f617602cfbb9eae214d8cce96e83e27ea (commit)
       via  aaf7510d41fbde7f9fc701f15baeadc4f02a2677 (commit)
       via  5642a98e3f1e1cd0b519972936562df047a31ccf (commit)
       via  cc2e8858c746cdf417497e9aef077fc70542ea30 (commit)
       via  8da2477093ebf0c5242422c039a554e287855b3f (commit)
       via  d66c26cb46c78c561db9b1c1db9eec91d95e1af7 (commit)
       via  66a63c60108fc89062983a1ffb974f242dbd87f6 (commit)
       via  64cc7ca67ca506b9fed9489ccd91f1c59999de32 (commit)
       via  8eed03394fd568c1caca780c96d00c2a6dd6d5d7 (commit)
       via  159aca731a6118bcd692cb96b96cf8cfb3be4ae8 (commit)
       via  b4dc1d69b89972ad46cf59f1529c5fff2f5f5286 (commit)
       via  1a7a42b17562a3c230f6fbb02c1f059fb815f30b (commit)
       via  ae7bce8650e1f374a5e34157578472c42d50476a (commit)
      from  f858c3a0770bf47eb47b4d790268eb523773d1ea (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email.

- Log -----------------------------------------------------------------
commit 9e26525dc904c6d7a01fad44348e590776aaa391
Merge: f858c3a0770bf47eb47b4d790268eb523773d1ea eacfc7f379ab26e2b6b90cedcc4f351c367c5e32
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Thu Nov 27 16:33:11 2008 +0100

    Merge commit 'origin/master' into archer-jankratochvil-vla

-----------------------------------------------------------------------

Summary of changes:
 bfd/ChangeLog                 |  123 +
 bfd/elf-bfd.h                 |   14 +
 bfd/elf-m10300.c              |   46 +-
 bfd/elf32-arm.c               |   71 +-
 bfd/elf32-bfin.c              |    4 -
 bfd/elf32-cris.c              |  986 +++++++-
 bfd/elf32-hppa.c              |   37 +-
 bfd/elf32-i370.c              |   49 +-
 bfd/elf32-i386.c              |   39 +-
 bfd/elf32-m32r.c              |   55 +-
 bfd/elf32-m68k.c              |   30 +-
 bfd/elf32-ppc.c               |   52 +-
 bfd/elf32-s390.c              |   40 +-
 bfd/elf32-sh.c                |   68 +-
 bfd/elf32-v850.c              |    4 +-
 bfd/elf32-vax.c               |   48 +-
 bfd/elf64-alpha.c             |   37 +-
 bfd/elf64-ppc.c               |   38 +-
 bfd/elf64-s390.c              |   41 +-
 bfd/elf64-sh64.c              |   48 +-
 bfd/elf64-x86-64.c            |   39 +-
 bfd/elflink.c                 |  149 ++-
 bfd/elfxx-sparc.c             |   37 +-
 bfd/elfxx-target.h            |    4 +
 bfd/version.h                 |    2 +-
 bfd/xtensa-isa.c              |   11 +
 gdb/ChangeLog                 |   74 +
 gdb/ada-lang.c                |   20 -
 gdb/ada-lang.h                |    4 -
 gdb/alpha-mdebug-tdep.c       |    2 +-
 gdb/breakpoint.c              |   44 +-
 gdb/breakpoint.h              |    4 -
 gdb/completer.c               |    2 +
 gdb/configure                 | 5187 +----------------------------------------
 gdb/configure.ac              |   74 +-
 gdb/doc/ChangeLog             |    4 +
 gdb/doc/gdb.texinfo           |    2 +-
 gdb/frame.c                   |   14 +-
 gdb/gdbserver/ChangeLog       |    8 +
 gdb/gdbserver/Makefile.in     |    7 -
 gdb/gdbserver/server.c        |   27 +-
 gdb/infrun.c                  |    1 -
 gdb/parse.c                   |    6 +-
 gdb/python/python-internal.h  |   12 +
 gdb/python/python-utils.c     |   17 +
 gdb/python/python.c           |   24 +-
 gdb/remote.c                  |   46 +-
 gdb/valprint.c                |    8 +-
 gdb/value.c                   |   20 +
 gdb/value.h                   |    4 +
 gdb/version.in                |    2 +-
 include/ChangeLog             |    5 +
 include/elf/ChangeLog         |    5 +
 include/elf/cris.h            |    9 +-
 include/xtensa-isa-internal.h |    6 +-
 include/xtensa-isa.h          |   12 +-
 opcodes/ChangeLog             |    4 +
 opcodes/m68k-dis.c            |  416 ++--
 58 files changed, 1844 insertions(+), 6298 deletions(-)

First 500 lines of diff:
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 4e8db37..ea17423 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,126 @@
+2008-11-25  Joseph Myers  <joseph@codesourcery.com>
+
+	* elf32-arm.c (elf32_arm_final_link_relocate): Do not turn
+	branches to undefine weak symbols into branches to the next
+	instruction if creating PLT entries for those symbols.
+
+2008-11-25  Nick Clifton  <nickc@redhat.com>
+
+	* elflink.c (is_reloc_section): New function.  Returns true if the
+	given name matches the name of the reloc-containing section
+	associated with the given section.
+	(get_dynamic_reloc_section_name): New function.  Computes the name
+	of the section that contains the dynamic relocs associated with
+	the given section.
+	(_bfd_elf_get_dynamic_reloc_section): New function.  Returns a
+	pointer to the section containing the dynamic relocs associated
+	with the given section.
+	(_bfd_elf_make_dynamic_reloc_section): New function.  Creates a
+	section to contain the dynamic relocs associated with a given
+	section.
+	* elf-bfd.h: Prototype the new functions.
+	* elf-m10300.c (mn10300_elf_check_relocs): Use new functions.
+	(mn10300_elf_final_link_relocs): Likewise.
+	* elf32-arm.c (reloc_section_p): Delete - replaced by new
+	functions.
+	(elf32_arm_final_link_relocate): Use new functions.
+	(elf32_arm_check_relocs): Likewise.
+	* elf32-cris.c (cris_elf_relocate_section): Likewise.
+	(elf_cris_check_relocs): Likewise.
+	* elf32-hppa.c (elf32_hppa_check_relocs): Likewise.
+	* elf32-i370.c (i370_elf_check_relocs): Likewise.
+	(i370_elf_relocate_section): Likewise.
+	* elf32-i386.c (elf_i386_check_relocs): Likewise.
+	* elf32-m32r.c (m32r_elf_relocate_section): Likewise.
+	(m32r_elf_check_relocs): Likewise.
+	* elf32-m68k.c (elf_m68k_check_relocs): Likewise.
+	* elf32_ppc.c (ppc_elf_check_relocs): Likewise.
+	(ppc_elf_relocate_section): Likewise.
+	* elf32-s390.c (elf_s390_check_relocs): Likewise.
+	* elf32-sh.c (sh_elf_relocate_section): Likewise.
+	(sh_elf_check_relocs): Likewise.
+	* elf32-vax.c (elf_vax_check_relocs): Likewise.
+	(elf_vax_relocate_section): Likewise.
+	* elf64-alpha.c (elf64_alpha_check_relocs): Likewise.
+	* elf64-ppc.c (ppc64_elf_check_relocs): Likewise.
+	* elf64-s390.c (elf_s390_check_relocs): Likewise.
+	* elf64-sh64.c (sh_elf64_relocate_section): Likewise.
+	* elf64-x86-64.c (elf64_x86_64_check_relocs): Likewise.
+	* elfxx-sparc.c (_bfd_sparc_elf_check_relocs): Likewise.
+	* elf32-bfin.c (bfin_check_relocs): Remove redundant local
+	variable 'sreloc'.
+	(bfin_relocate_section): Likewise.
+	* elf32-v850.c (v850_elf_check_relocs): Likewise.
+
+2008-11-23  Hans-Peter Nilsson  <hp@axis.com>
+
+	Implement TLS for CRIS.
+	* elf32-cris.c: Include limits.h.
+	(TLSHOWTO16): Redefine in terms of and move contents to...
+	(TLSHOWTO16X): New macro.
+	(TLSHOWTO16S, LGOT_REG_NDX, LGOT_DTP_NDX, LGOT_ALLOC_NELTS_FOR)
+	(elf_cris_hash_entry): New macros.
+	(cris_elf_howto_table): Make R_CRIS_16_DTPREL,
+	R_CRIS_16_GOT_TPREL, R_CRIS_16_TPREL check overflow for signed,
+	not unsigned values.
+	(cris_info_to_howto_rela): Make r_type a enum elf_cris_reloc_type,
+	not unsigned int.
+	(struct elf_cris_link_hash_entry): New members reg_got_refcount,
+	tprel_refcount, and dtp_refcount.
+	(struct elf_cris_link_hash_table): New member dtpmod_refcount.
+	(elf_cris_link_hash_newfunc): Initialize new members.
+	(elf_cris_link_hash_table_create): Similar.
+	(cris_final_link_relocate, elf_cris_reloc_type_class): Use a
+	temporary variable when testing the relocation type.
+	(cris_elf_gc_mark_hook): Ditto.  Add default case where needed.
+	(cris_elf_gc_sweep_hook): Ditto.  Handle reference-counting for
+	the new assembly-generated relocs.  Rewrite refcount handling to
+	set temporary variables to pointers to reloc-specific variables
+	and entry size and common code for the update.
+	(additional_relocation_error_msg_count): New variable.
+	(cris_elf_relocate_section): Use a function-local variable srelgot
+	for the .rela.got section instead of looking it up for every need.
+	Make r_type a enum elf_cris_reloc_type, not int.  Actually set
+	symname for non-local symbols.  Handle new assembly-generated
+	relocs.  For overflow, emit additional messages for the new 16-bit
+	relocs as well as R_CRIS_16_GOTPLT and R_CRIS_16_GOT.
+	(elf_cris_finish_dynamic_symbol): Use elf_cris_finish_dynamic_symbol
+	instead of plain casts.  Check new hash entry member 
+	reg_got_refcount when checking whether to emit a GOT entry.
+	(elf_cris_finish_dynamic_sections): Update head comment to warn
+	about emitting relocs here.  Use a temporary variable when testing
+	the relocation type.
+	(elf_cris_discard_excess_program_dynamics)
+	(elf_cris_adjust_gotplt_to_got): Handle reference counting change
+	regarding h->reg_got_refcount.
+	(cris_elf_check_relocs): Rewrite refcount handling to set
+	temporary variables and entry size and common code for the update
+	for local symbols.  Use new macro elf_cris_hash_entry.  Adjust
+	allocation for change in reference counting of GOT entries for
+	local symbols.
+	(elf_cris_size_dynamic_sections): Adjust calculated size of
+	.got.plt and .rela.got if we need a GOT entry for a
+	R_CRIS_DTPMOD relocation.
+	(elf_cris_got_elt_size): New function.
+	(elf_backend_got_elt_size): Define.
+
+2008-11-21  Sterling Augustine  <sterling@tensilica.com>
+
+	* xtensa-isa.c (xtensa_state_is_shared_or): New function.
+
+2008-11-21  Hans-Peter Nilsson  <hp@axis.com>
+
+	* elf-bfd.h (struct elf_backend_data): New member got_elt_size.
+	(_bfd_elf_default_got_elt_size): Declare.
+	* elflink.c (struct alloc_got_off_arg): Replace member got_elt_size
+	by new member info.
+	(elf_gc_allocate_got_offsets): Adjust for calling bed->got_elt_size
+	to get the element size instead of using a gofarg entry.
+	(bfd_elf_gc_common_finalize_got_offsets): Similar.
+	(_bfd_elf_default_got_elt_size): New function.
+	* elfxx-target.h: New macro elf_backend_got_elt_size.
+	(elfNN_bed): Use it.
+
 2008-11-20  Tristan Gingold  <gingold@adacore.com>
 
 	* bfdwin.c: Fix comment.
diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h
index 9615a4a..5418e7f 100644
--- a/bfd/elf-bfd.h
+++ b/bfd/elf-bfd.h
@@ -1147,6 +1147,12 @@ struct elf_backend_data
      so-called reserved entries on some systems.  */
   bfd_vma got_header_size;
 
+  /* The size of the GOT entry for the symbol pointed to by H if non-NULL,
+     otherwise by the local symbol with index SYMNDX in IBFD.  */
+  bfd_vma (*got_elt_size) (bfd *, struct bfd_link_info *,
+			   struct elf_link_hash_entry *h,
+			   bfd *ibfd, unsigned long symndx);
+
   /* The vendor name to use for a processor-standard attributes section.  */
   const char *obj_attrs_vendor;
 
@@ -1758,6 +1764,10 @@ extern long _bfd_elf_get_reloc_upper_bound
   (bfd *, sec_ptr);
 extern long _bfd_elf_canonicalize_reloc
   (bfd *, sec_ptr, arelent **, asymbol **);
+extern asection * _bfd_elf_get_dynamic_reloc_section
+  (bfd *, asection *, bfd_boolean);
+extern asection * _bfd_elf_make_dynamic_reloc_section
+  (asection *, bfd *, unsigned int, bfd *, bfd_boolean);
 extern long _bfd_elf_get_dynamic_reloc_upper_bound
   (bfd *);
 extern long _bfd_elf_canonicalize_dynamic_reloc
@@ -2070,6 +2080,10 @@ extern asection *_bfd_elf_common_section
 extern void _bfd_dwarf2_cleanup_debug_info
   (bfd *);
 
+extern bfd_vma _bfd_elf_default_got_elt_size
+(bfd *, struct bfd_link_info *, struct elf_link_hash_entry *, bfd *,
+ unsigned long);
+
 extern bfd_reloc_status_type _bfd_elf_rel_vtable_reloc_fn
   (bfd *, arelent *, struct bfd_symbol *, void *,
    asection *, bfd *, char **);
diff --git a/bfd/elf-m10300.c b/bfd/elf-m10300.c
index 37c4f3b..d41906c 100644
--- a/bfd/elf-m10300.c
+++ b/bfd/elf-m10300.c
@@ -917,32 +917,10 @@ mn10300_elf_check_relocs (bfd *abfd,
 		     section in dynobj and make room for this reloc.  */
 		  if (sreloc == NULL)
 		    {
-		      const char * name;
-
-		      name = (bfd_elf_string_from_elf_section
-			      (abfd,
-			       elf_elfheader (abfd)->e_shstrndx,
-			       elf_section_data (sec)->rel_hdr.sh_name));
-		      if (name == NULL)
-			goto fail;
-
-		      BFD_ASSERT (CONST_STRNEQ (name, ".rela")
-				  && streq (bfd_get_section_name (abfd, sec), name + 5));
-
-		      sreloc = bfd_get_section_by_name (dynobj, name);
+		      sreloc = _bfd_elf_make_dynamic_reloc_section
+			(sec, dynobj, 2, abfd, /*rela?*/ TRUE);
 		      if (sreloc == NULL)
-			{
-			  flagword flags;
-
-			  flags = (SEC_HAS_CONTENTS | SEC_READONLY
-			       | SEC_IN_MEMORY | SEC_LINKER_CREATED);
-			  if ((sec->flags & SEC_ALLOC) != 0)
-			    flags |= SEC_ALLOC | SEC_LOAD;
-			  sreloc = bfd_make_section_with_flags (dynobj, name, flags);
-			  if (sreloc == NULL
-			      || ! bfd_set_section_alignment (dynobj, sreloc, 2))
-			    goto fail;
-			}
+			goto fail;
 		    }
 
 		  sreloc->size += sizeof (Elf32_External_Rela);
@@ -1108,22 +1086,10 @@ mn10300_elf_final_link_relocate (reloc_howto_type *howto,
 	     time.  */
 	  if (sreloc == NULL)
 	    {
-	      const char * name;
-
-	      name = (bfd_elf_string_from_elf_section
-		      (input_bfd,
-		       elf_elfheader (input_bfd)->e_shstrndx,
-		       elf_section_data (input_section)->rel_hdr.sh_name));
-	      if (name == NULL)
+	      sreloc = _bfd_elf_get_dynamic_reloc_section
+		(input_bfd, input_section, /*rela?*/ TRUE);
+	      if (sreloc == NULL)
 		return FALSE;
-
-	      BFD_ASSERT (CONST_STRNEQ (name, ".rela")
-			  && streq (bfd_get_section_name (input_bfd,
-							  input_section),
-				    name + 5));
-
-	      sreloc = bfd_get_section_by_name (dynobj, name);
-	      BFD_ASSERT (sreloc != NULL);
 	    }
 
 	  skip = FALSE;
diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c
index 9008a4b..cd5a9bf 100644
--- a/bfd/elf32-arm.c
+++ b/bfd/elf32-arm.c
@@ -2466,19 +2466,6 @@ stub_hash_newfunc (struct bfd_hash_entry *entry,
   return entry;
 }
 
-/* Return true if NAME is the name of the relocation section associated
-   with S.  */
-
-static bfd_boolean
-reloc_section_p (struct elf32_arm_link_hash_table *htab,
-		 const char *name, asection *s)
-{
-  if (htab->use_rel)
-    return CONST_STRNEQ (name, ".rel") && strcmp (s->name, name + 4) == 0;
-  else
-    return CONST_STRNEQ (name, ".rela") && strcmp (s->name, name + 5) == 0;
-}
-
 /* Create .got, .gotplt, and .rel(a).got sections in DYNOBJ, and set up
    shortcuts to them in our hash table.  */
 
@@ -5960,19 +5947,11 @@ elf32_arm_final_link_relocate (reloc_howto_type *           howto,
 
 	  if (sreloc == NULL)
 	    {
-	      const char * name;
+	      sreloc = _bfd_elf_get_dynamic_reloc_section (input_bfd, input_section,
+							   ! globals->use_rel);
 
-	      name = (bfd_elf_string_from_elf_section
-		      (input_bfd,
-		       elf_elfheader (input_bfd)->e_shstrndx,
-		       elf_section_data (input_section)->rel_hdr.sh_name));
-	      if (name == NULL)
+	      if (sreloc == NULL)
 		return bfd_reloc_notsupported;
-
-	      BFD_ASSERT (reloc_section_p (globals, name, input_section));
-
-	      sreloc = bfd_get_section_by_name (dynobj, name);
-	      BFD_ASSERT (sreloc != NULL);
 	    }
 
 	  skip = FALSE;
@@ -6381,8 +6360,9 @@ elf32_arm_final_link_relocate (reloc_howto_type *           howto,
 	int thumb2 = using_thumb2 (globals);
 
 	/* A branch to an undefined weak symbol is turned into a jump to
-	   the next instruction.  */
-	if (h && h->root.type == bfd_link_hash_undefweak)
+	   the next instruction unless a PLT entry will be created.  */
+	if (h && h->root.type == bfd_link_hash_undefweak
+	    && !(splt != NULL && h->plt.offset != (bfd_vma) -1))
 	  {
 	    bfd_put_16 (input_bfd, 0xe000, hit_data);
 	    bfd_put_16 (input_bfd, 0xbf00, hit_data + 2);
@@ -9278,40 +9258,23 @@ elf32_arm_check_relocs (bfd *abfd, struct bfd_link_info *info,
 	        /* When creating a shared object, we must copy these
                    reloc types into the output file.  We create a reloc
                    section in dynobj and make room for this reloc.  */
-	        if (sreloc == NULL)
+  	        if (sreloc == NULL)
 		  {
-		    const char * name;
+		    sreloc = _bfd_elf_make_dynamic_reloc_section
+		      (sec, dynobj, 2, abfd, ! htab->use_rel);
 
-		    name = (bfd_elf_string_from_elf_section
-			    (abfd,
-			     elf_elfheader (abfd)->e_shstrndx,
-			     elf_section_data (sec)->rel_hdr.sh_name));
-		    if (name == NULL)
+		    if (sreloc == NULL)
 		      return FALSE;
 
-		    BFD_ASSERT (reloc_section_p (htab, name, sec));
-
-		    sreloc = bfd_get_section_by_name (dynobj, name);
-		    if (sreloc == NULL)
+		    /* BPABI objects never have dynamic relocations mapped.  */
+		    if (! htab->symbian_p)
 		      {
-		        flagword flags;
-
-		        flags = (SEC_HAS_CONTENTS | SEC_READONLY
-			         | SEC_IN_MEMORY | SEC_LINKER_CREATED);
-		        if ((sec->flags & SEC_ALLOC) != 0
-			    /* BPABI objects never have dynamic
-			       relocations mapped.  */
-			    && !htab->symbian_p)
-			  flags |= SEC_ALLOC | SEC_LOAD;
-		        sreloc = bfd_make_section_with_flags (dynobj,
-							      name,
-							      flags);
-		        if (sreloc == NULL
-			    || ! bfd_set_section_alignment (dynobj, sreloc, 2))
-			  return FALSE;
-		      }
+			flagword flags;
 
-		    elf_section_data (sec)->sreloc = sreloc;
+			flags = bfd_get_section_flags (dynobj, sreloc);
+			flags &= ~(SEC_LOAD | SEC_ALLOC);
+			bfd_set_section_flags (dynobj, sreloc, flags);
+		      }
 		  }
 
 		/* If this is a global symbol, we count the number of
diff --git a/bfd/elf32-bfin.c b/bfd/elf32-bfin.c
index a5c2400..c7d1124 100644
--- a/bfd/elf32-bfin.c
+++ b/bfd/elf32-bfin.c
@@ -1150,7 +1150,6 @@ bfin_check_relocs (bfd * abfd,
   const Elf_Internal_Rela *rel_end;
   asection *sgot;
   asection *srelgot;
-  asection *sreloc;
   if (info->relocatable)
     return TRUE;
 
@@ -1161,7 +1160,6 @@ bfin_check_relocs (bfd * abfd,
 
   sgot = NULL;
   srelgot = NULL;
-  sreloc = NULL;
 
   rel_end = relocs + sec->reloc_count;
   for (rel = relocs; rel < rel_end; rel++)
@@ -1363,7 +1361,6 @@ bfin_relocate_section (bfd * output_bfd,
   struct elf_link_hash_entry **sym_hashes;
   bfd_vma *local_got_offsets;
   asection *sgot;
-  asection *sreloc;
   Elf_Internal_Rela *rel;
   Elf_Internal_Rela *relend;
   int i = 0;
@@ -1374,7 +1371,6 @@ bfin_relocate_section (bfd * output_bfd,
   local_got_offsets = elf_local_got_offsets (input_bfd);
 
   sgot = NULL;
-  sreloc = NULL;
 
   rel = relocs;
   relend = relocs + input_section->reloc_count;
diff --git a/bfd/elf32-cris.c b/bfd/elf32-cris.c
index 360cba6..72916f2 100644
--- a/bfd/elf32-cris.c
+++ b/bfd/elf32-cris.c
@@ -1,5 +1,5 @@
 /* CRIS-specific support for 32-bit ELF.
-   Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
+   Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
    Free Software Foundation, Inc.
    Contributed by Axis Communications AB.
    Written by Hans-Peter Nilsson, based on elf32-fr30.c
@@ -27,6 +27,7 @@
 #include "libbfd.h"
 #include "elf-bfd.h"
 #include "elf/cris.h"
+#include <limits.h>
 
 /* Forward declarations.  */
 static reloc_howto_type * cris_reloc_type_lookup
@@ -419,20 +420,22 @@ static reloc_howto_type cris_elf_howto_table [] =
 #define TLSHOWTO32(name) \
  HOWTO (name, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, \
         bfd_elf_generic_reloc, #name, FALSE, 0, 0xffffffff, FALSE)
-#define TLSHOWTO16(name) \
- HOWTO (name, 0, 1, 16, FALSE, 0, complain_overflow_bitfield, \
+#define TLSHOWTO16X(name, X)	     \
+ HOWTO (name, 0, 1, 16, FALSE, 0, complain_overflow_ ## X, \
         bfd_elf_generic_reloc, #name, FALSE, 0, 0xffff, FALSE)
+#define TLSHOWTO16(name) TLSHOWTO16X(name, unsigned)
+#define TLSHOWTO16S(name) TLSHOWTO16X(name, signed)
 
   TLSHOWTO32 (R_CRIS_32_GOT_GD),
   TLSHOWTO16 (R_CRIS_16_GOT_GD),
   TLSHOWTO32 (R_CRIS_32_GD),
   TLSHOWTO32 (R_CRIS_DTP),
   TLSHOWTO32 (R_CRIS_32_DTPREL),
-  TLSHOWTO16 (R_CRIS_16_DTPREL),
+  TLSHOWTO16S (R_CRIS_16_DTPREL),
   TLSHOWTO32 (R_CRIS_32_GOT_TPREL),
-  TLSHOWTO16 (R_CRIS_16_GOT_TPREL),
+  TLSHOWTO16S (R_CRIS_16_GOT_TPREL),
   TLSHOWTO32 (R_CRIS_32_TPREL),
-  TLSHOWTO16 (R_CRIS_16_TPREL),
+  TLSHOWTO16S (R_CRIS_16_TPREL),
   TLSHOWTO32 (R_CRIS_DTPMOD)
 };
 \f
@@ -516,7 +519,7 @@ cris_info_to_howto_rela (abfd, cache_ptr, dst)
      arelent * cache_ptr;
      Elf_Internal_Rela * dst;
 {
-  unsigned int r_type;
+  enum elf_cris_reloc_type r_type;
 
   r_type = ELF32_R_TYPE (dst->r_info);
   BFD_ASSERT (r_type < (unsigned int) R_CRIS_max);
@@ -818,8 +821,39 @@ struct elf_cris_link_hash_entry
      this with gotplt_refcount in a union, like the got and plt unions in
      elf_link_hash_entry.  */
   bfd_size_type gotplt_offset;
+
+  /* The root.got.refcount is the sum of the regular reference counts
+     (this) and those members below.  We have to keep a separate count
+     to track when we've found the first (or last) reference to a
+     regular got entry.  The offset is in root.got.offset.  */
+  bfd_signed_vma reg_got_refcount;
+
+  /* Similar to the above, the number of reloc references to this
+     symbols that need a R_CRIS_32_TPREL slot.  The offset is in
+     root.got.offset, because this and .dtp_refcount can't validly
+     happen when there's also a regular GOT entry; that's invalid
+     input for which an error is emitted.  */
+  bfd_signed_vma tprel_refcount;
+
+  /* Similar to the above, the number of reloc references to this
+     symbols that need a R_CRIS_DTP slot.  The offset is in
+     root.got.offset; plus 4 if .tprel_refcount > 0.  */
+  bfd_signed_vma dtp_refcount;
 };
 
+/* The local_got_refcounts and local_got_offsets are a multiple of
+   LSNUM in size, namely LGOT_ALLOC_NELTS_FOR(LSNUM) (plus one for the
+   refcount for GOT itself, see code), with the summary / group offset
+   for local symbols located at offset N, reference counts for
+   ordinary (address) relocs at offset N + LSNUM, for R_CRIS_DTP
+   relocs at offset N + 2*LSNUM, and for R_CRIS_32_TPREL relocs at N +
+   3*LSNUM.  */
+
+#define LGOT_REG_NDX(x) ((x) + symtab_hdr->sh_info)
+#define LGOT_DTP_NDX(x) ((x) + 2 * symtab_hdr->sh_info)
+#define LGOT_TPREL_NDX(x) ((x) + 3 * symtab_hdr->sh_info)
+#define LGOT_ALLOC_NELTS_FOR(x) ((x) * 4)
+
 /* CRIS ELF linker hash table.  */
 
 struct elf_cris_link_hash_table
@@ -830,6 +864,13 @@ struct elf_cris_link_hash_table
      since we try and avoid creating GOTPLT:s when there's already a GOT.
      Instead, we keep and update the next available index here.  */
   bfd_size_type next_gotplt_entry;
+
+  /* The number of R_CRIS_32_DTPREL and R_CRIS_16_DTPREL that have
+     been seen for any input; if != 0, then the constant-offset
+     R_CRIS_DTPMOD is needed for this DSO/executable.  This turns
+     negative at relocation, so that we don't need an extra flag for
+     when the reloc is output.  */
+  bfd_signed_vma dtpmod_refcount;
 };
 
 /* Traverse a CRIS ELF linker hash table.  */
@@ -845,6 +886,13 @@ struct elf_cris_link_hash_table
 #define elf_cris_hash_table(p) \
   ((struct elf_cris_link_hash_table *) (p)->hash)
 
+/* Get the CRIS ELF linker hash entry from a regular hash entry (the
+   "parent class").  The .root reference is just a simple type
+   check on the argument.  */


hooks/post-receive
--
Repository for Project Archer.


             reply	other threads:[~2008-11-27 15:52 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-27 15:52 jkratoch [this message]
2008-12-07  2:49 jkratoch
2008-12-14 23:51 jkratoch
2008-12-28 16:26 jkratoch
2009-07-30 21:17 jkratoch
2009-07-31 18:51 jkratoch
2009-08-19 15:23 jkratoch
2009-09-01 11:53 jkratoch
2009-09-09 16:16 jkratoch

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20081127155229.21282.qmail@sourceware.org \
    --to=jkratoch@sourceware.org \
    --cc=archer-commits@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).