This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

struct bfd_section packed flags


I noticed recently that some of the section flag names don't
correspond to their use.  It would have been easy enough to update the
names so that at least some backend used sensible names, but because
backends like ppc64 reuse flags I opted to make the names generic.

	* section.c (struct bfd_section): Delete has_tls_reloc,
	has_tls_get_addr_call, has_gp_reloc, need_finalize_relax, reloc_done.
	Add sec_flg0 thru sec_flg5.
	(BFD_FAKE_SECTION): Update for changed flags.
	* ecoff.c (bfd_debug_section): Likewise.
	* elf32-ppc.c (has_tls_reloc, has_tls_get_addr_call): Define.
	* elf64-ppc.c (has_tls_reloc, has_tls_get_addr_call): Define.
	(has_toc_reloc, makes_toc_func_call, call_check_in_progress): Update.
	* elf32-xtensa.c (reloc_done): Define.
	* elfxx-ia64.c (skip_relax_pass_0, skip_relax_pass_1): Update.
	* bfd-in2.h: Regenerate.

Index: bfd/section.c
===================================================================
RCS file: /cvs/src/src/bfd/section.c,v
retrieving revision 1.104
diff -u -p -r1.104 section.c
--- bfd/section.c	9 Sep 2009 21:38:58 -0000	1.104
+++ bfd/section.c	8 Feb 2010 06:07:12 -0000
@@ -383,20 +383,12 @@ CODE_FRAGMENT
 .  {* Bits used by various backends.  The generic code doesn't touch
 .     these fields.  *}
 .
-.  {* Nonzero if this section has TLS related relocations.  *}
-.  unsigned int has_tls_reloc:1;
-.
-.  {* Nonzero if this section has a call to __tls_get_addr.  *}
-.  unsigned int has_tls_get_addr_call:1;
-.
-.  {* Nonzero if this section has a gp reloc.  *}
-.  unsigned int has_gp_reloc:1;
-.
-.  {* Nonzero if this section needs the relax finalize pass.  *}
-.  unsigned int need_finalize_relax:1;
-.
-.  {* Whether relocations have been processed.  *}
-.  unsigned int reloc_done : 1;
+.  unsigned int sec_flg0:1;
+.  unsigned int sec_flg1:1;
+.  unsigned int sec_flg2:1;
+.  unsigned int sec_flg3:1;
+.  unsigned int sec_flg4:1;
+.  unsigned int sec_flg5:1;
 .
 .  {* End of internal packed boolean fields.  *}
 .
@@ -661,17 +653,17 @@ CODE_FRAGMENT
 .  {* name, id,  index, next, prev, flags, user_set_vma,            *}	\
 .  { NAME,  IDX, 0,     NULL, NULL, FLAGS, 0,				\
 .									\
-.  {* linker_mark, linker_has_input, gc_mark,                       *}	\
-.     0,           0,                1,         			\
+.  {* linker_mark, linker_has_input, gc_mark, segment_mark,         *}	\
+.     0,           0,                1,       0,			\
 .									\
-.  {* segment_mark, sec_info_type, use_rela_p, has_tls_reloc,       *}	\
-.     0,            0,             0,          0,			\
+.  {* sec_info_type, use_rela_p,                                    *}	\
+.     0,             0,							\
 .									\
-.  {* has_tls_get_addr_call, has_gp_reloc, need_finalize_relax,     *}	\
-.     0,                     0,            0,				\
+.  {* sec_flg0, sec_flg1, sec_flg2, sec_flg3, sec_flg4, sec_flg5,   *}	\
+.     0,        0,        0,        0,        0,        0,		\
 .									\
-.  {* reloc_done, vma, lma, size, rawsize, relax, relax_count,      *}	\
-.     0,          0,   0,   0,    0,       0,     0,			\
+.  {* vma, lma, size, rawsize, relax, relax_count,                  *}	\
+.     0,   0,   0,    0,       0,     0,				\
 .									\
 .  {* output_offset, output_section,              alignment_power,  *}	\
 .     0,             (struct bfd_section *) &SEC, 0,			\
Index: bfd/ecoff.c
===================================================================
RCS file: /cvs/src/src/bfd/ecoff.c,v
retrieving revision 1.67
diff -u -p -r1.67 ecoff.c
--- bfd/ecoff.c	11 Dec 2009 13:42:02 -0000	1.67
+++ bfd/ecoff.c	8 Feb 2010 06:06:45 -0000
@@ -56,14 +56,14 @@ static asection bfd_debug_section =
 {
   /* name,      id,  index, next, prev, flags, user_set_vma,       */
      "*DEBUG*", 0,   0,     NULL, NULL, 0,     0,
-  /* linker_mark, linker_has_input, gc_mark,                       */
-     0,           0,                1,
-  /* segment_mark, sec_info_type, use_rela_p, has_tls_reloc,       */
-     0,            0,             0,          0,
-  /* has_tls_get_addr_call, has_gp_reloc, need_finalize_relax,     */
-     0,                     0,            0,
-  /* reloc_done, vma, lma, size, rawsize, relax, relax_count,      */
-     0,          0,   0,   0,    0,       0,     0,
+  /* linker_mark, linker_has_input, gc_mark, segment_mark,         */
+     0,           0,                1,       0,
+  /* sec_info_type, use_rela_p,                                    */
+     0,             0,
+  /* sec_flg0, sec_flg1, sec_flg2, sec_flg3, sec_flg4, sec_flg5,   */
+     0,        0,        0,        0,        0,        0,
+  /* vma, lma, size, rawsize, relax, relax_count,                  */
+     0,   0,   0,    0,       0,     0,
   /* output_offset, output_section, alignment_power,               */
      0,             NULL,           0,
   /* relocation, orelocation, reloc_count, filepos, rel_filepos,   */
Index: bfd/elf32-ppc.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-ppc.c,v
retrieving revision 1.276
diff -u -p -r1.276 elf32-ppc.c
--- bfd/elf32-ppc.c	8 Feb 2010 00:48:27 -0000	1.276
+++ bfd/elf32-ppc.c	8 Feb 2010 06:06:54 -0000
@@ -2779,6 +2779,15 @@ struct ppc_elf_link_hash_table
   struct sym_cache sym_cache;
 };
 
+/* Rename some of the generic section flags to better document how they
+   are used here.  */
+
+/* Nonzero if this section has TLS related relocations.  */
+#define has_tls_reloc sec_flg0
+
+/* Nonzero if this section has a call to __tls_get_addr.  */
+#define has_tls_get_addr_call sec_flg1
+
 /* Get the PPC ELF linker hash table from a link_info structure.  */
 
 #define ppc_elf_hash_table(p) \
Index: bfd/elf32-xtensa.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-xtensa.c,v
retrieving revision 1.120
diff -u -p -r1.120 elf32-xtensa.c
--- bfd/elf32-xtensa.c	4 Feb 2010 09:16:40 -0000	1.120
+++ bfd/elf32-xtensa.c	8 Feb 2010 06:06:58 -0000
@@ -155,6 +155,10 @@ static bfd_boolean relaxing_section = FA
 
 int elf32xtensa_no_literal_movement = 1;
 
+/* Rename one of the generic section flags to better document how it
+   is used here.  */
+/* Whether relocations have been processed.  */
+#define reloc_done sec_flg0
 
 static reloc_howto_type elf_howto_table[] =
 {
Index: bfd/elf64-ppc.c
===================================================================
RCS file: /cvs/src/src/bfd/elf64-ppc.c,v
retrieving revision 1.311
diff -u -p -r1.311 elf64-ppc.c
--- bfd/elf64-ppc.c	4 Feb 2010 09:16:41 -0000	1.311
+++ bfd/elf64-ppc.c	8 Feb 2010 06:07:01 -0000
@@ -3799,9 +3800,22 @@ struct ppc_link_hash_table
 
 /* Rename some of the generic section flags to better document how they
    are used here.  */
-#define has_toc_reloc has_gp_reloc
-#define makes_toc_func_call need_finalize_relax
-#define call_check_in_progress reloc_done
+
+/* Nonzero if this section has TLS related relocations.  */
+#define has_tls_reloc sec_flg0
+
+/* Nonzero if this section has a call to __tls_get_addr.  */
+#define has_tls_get_addr_call sec_flg1
+
+/* Nonzero if this section has any toc or got relocs.  */
+#define has_toc_reloc sec_flg2
+
+/* Nonzero if this section has a call to another section that uses
+   the toc or got.  */
+#define makes_toc_func_call sec_flg4
+
+/* Recursion protection when determining above flag.  */
+#define call_check_in_progress sec_flg5
 
 /* Get the ppc64 ELF linker hash table from a link_info structure.  */
 
Index: bfd/elfxx-ia64.c
===================================================================
RCS file: /cvs/src/src/bfd/elfxx-ia64.c,v
retrieving revision 1.220
diff -u -p -r1.220 elfxx-ia64.c
--- bfd/elfxx-ia64.c	4 Feb 2010 09:16:41 -0000	1.220
+++ bfd/elfxx-ia64.c	8 Feb 2010 06:07:06 -0000
@@ -755,8 +755,8 @@ elfNN_ia64_relax_brl (bfd_byte *contents
 
 /* Rename some of the generic section flags to better document how they
    are used here.  */
-#define skip_relax_pass_0 need_finalize_relax
-#define skip_relax_pass_1 has_gp_reloc
+#define skip_relax_pass_0 sec_flg0
+#define skip_relax_pass_1 sec_flg1
 
 
 /* These functions do relaxation for IA-64 ELF.  */

-- 
Alan Modra
Australia Development Lab, IBM


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]