OSDN Git Service

bfd/
authorhjl <hjl>
Tue, 22 Feb 2005 00:50:01 +0000 (00:50 +0000)
committerhjl <hjl>
Tue, 22 Feb 2005 00:50:01 +0000 (00:50 +0000)
2005-02-21  H.J. Lu  <hongjiu.lu@intel.com>

* coffcode.h (sec_to_styp_flags): Replaced SEC_CLINK with
SEC_TIC54X_CLINK. Replace SEC_BLOCK with SEC_TIC54X_BLOCK.
Replace SEC_SHARED with SEC_COFF_SHARED.
(styp_to_sec_flags): Likewise.

* elfxx-target.h (TARGET_BIG_SYM): Remove SEC_ARCH_BIT_0.
(TARGET_LITTLE_SYM): Likewise.

* section.c (SEC_ARCH_BIT_0): Removed.
(SEC_LINK_DUPLICATES_SAME_CONTENTS): Defined with
SEC_LINK_DUPLICATES_ONE_ONLY and SEC_LINK_DUPLICATES_SAME_SIZE.
(SEC_SHARED): Renamed to ...
(SEC_COFF_SHARED): This.
(SEC_BLOCK): Renamed to ...
(SEC_TIC54X_BLOCK): This.
(SEC_CLINK): Renamed to ...
(SEC_TIC54X_CLINK): This.
(SEC_XXX): Rearranged. Move SEC_COFF_SHARED_LIBRARY,
SEC_COFF_SHARED, SEC_TIC54X_BLOCK and SEC_TIC54X_CLINK to the
end.
* bfd-in2.h: Regenerated.

binutils/

2005-02-21  H.J. Lu  <hongjiu.lu@intel.com>

* objcopy.c (parse_flags): Replace SEC_SHARED with
SEC_COFF_SHARED.

* objdump.c (dump_section_header): Dump SEC_TIC54X_BLOCK and
SEC_TIC54X_CLINK for TI c54x only. Remove SEC_ARCH_BIT_0. Dump
SEC_COFF_SHARED for COFF only.

gas/

2005-02-21  H.J. Lu  <hongjiu.lu@intel.com>

* config/obj-coff.c (obj_coff_section): Replace SEC_SHARED with
SEC_COFF_SHARED.

* config/tc-tic54x.c (tic54x_bss): Replace SEC_BLOCK with
SEC_TIC54X_BLOCK.
(demand_empty_rest_of_line): Likewise.
(tic54x_sblock): Likewise.
(tic54x_clink): Replace with SEC_CLINK with SEC_TIC54X_CLINK.

ld/

2005-02-21  H.J. Lu  <hongjiu.lu@intel.com>

* ldlang.c (lang_add_section): Check SEC_TIC54X_BLOCK for TI
tic54x input only.
(lang_size_sections_1): Check SEC_COFF_SHARED_LIBRARY for COFF
and ECOFF output only.

13 files changed:
bfd/ChangeLog
bfd/bfd-in2.h
bfd/coffcode.h
bfd/elfxx-target.h
bfd/section.c
binutils/ChangeLog
binutils/objcopy.c
binutils/objdump.c
gas/ChangeLog
gas/config/obj-coff.c
gas/config/tc-tic54x.c
ld/ChangeLog
ld/ldlang.c

index 74ae25f..2d95ec2 100644 (file)
@@ -1,3 +1,27 @@
+2005-02-21  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * coffcode.h (sec_to_styp_flags): Replaced SEC_CLINK with
+       SEC_TIC54X_CLINK. Replace SEC_BLOCK with SEC_TIC54X_BLOCK.
+       Replace SEC_SHARED with SEC_COFF_SHARED.
+       (styp_to_sec_flags): Likewise.
+
+       * elfxx-target.h (TARGET_BIG_SYM): Remove SEC_ARCH_BIT_0.
+       (TARGET_LITTLE_SYM): Likewise.
+
+       * section.c (SEC_ARCH_BIT_0): Removed.
+       (SEC_LINK_DUPLICATES_SAME_CONTENTS): Defined with
+       SEC_LINK_DUPLICATES_ONE_ONLY and SEC_LINK_DUPLICATES_SAME_SIZE.
+       (SEC_SHARED): Renamed to ...
+       (SEC_COFF_SHARED): This.
+       (SEC_BLOCK): Renamed to ...
+       (SEC_TIC54X_BLOCK): This.
+       (SEC_CLINK): Renamed to ...
+       (SEC_TIC54X_CLINK): This.
+       (SEC_XXX): Rearranged. Move SEC_COFF_SHARED_LIBRARY,
+       SEC_COFF_SHARED, SEC_TIC54X_BLOCK and SEC_TIC54X_CLINK to the
+       end.
+       * bfd-in2.h: Regenerated.
+
 2005-02-21  Fred Fish  <fnf@specifixinc.com>
 
        * dwarf2.c (find_abstract_instance_name): Call recursively
index 930c242..65a076d 100644 (file)
@@ -1075,23 +1075,17 @@ typedef struct bfd_section
      some relocation information too.  */
 #define SEC_RELOC      0x004
 
-  /* ELF reserves 4 processor specific bits and 8 operating system
-     specific bits in sh_flags; at present we can get away with just
-     one in communicating between the assembler and BFD, but this
-     isn't a good long-term solution.  */
-#define SEC_ARCH_BIT_0 0x008
-
   /* A signal to the OS that the section contains read only data.  */
-#define SEC_READONLY   0x010
+#define SEC_READONLY   0x008
 
   /* The section contains code only.  */
-#define SEC_CODE       0x020
+#define SEC_CODE       0x010
 
   /* The section contains data only.  */
-#define SEC_DATA       0x040
+#define SEC_DATA       0x020
 
   /* The section will reside in ROM.  */
-#define SEC_ROM        0x080
+#define SEC_ROM        0x040
 
   /* The section contains constructor information. This section
      type is used by the linker to create lists of constructors and
@@ -1103,30 +1097,19 @@ typedef struct bfd_section
      sections called <<__CTOR_LIST__>> and relocate the data
      contained within - exactly the operations it would peform on
      standard data.  */
-#define SEC_CONSTRUCTOR 0x100
+#define SEC_CONSTRUCTOR 0x080
 
   /* The section has contents - a data section could be
      <<SEC_ALLOC>> | <<SEC_HAS_CONTENTS>>; a debug section could be
      <<SEC_HAS_CONTENTS>>  */
-#define SEC_HAS_CONTENTS 0x200
+#define SEC_HAS_CONTENTS 0x100
 
   /* An instruction to the linker to not output the section
      even if it has information which would normally be written.  */
-#define SEC_NEVER_LOAD 0x400
-
-  /* The section is a COFF shared library section.  This flag is
-     only for the linker.  If this type of section appears in
-     the input file, the linker must copy it to the output file
-     without changing the vma or size.  FIXME: Although this
-     was originally intended to be general, it really is COFF
-     specific (and the flag was renamed to indicate this).  It
-     might be cleaner to have some more general mechanism to
-     allow the back end to control what the linker does with
-     sections.  */
-#define SEC_COFF_SHARED_LIBRARY 0x800
+#define SEC_NEVER_LOAD 0x200
 
   /* The section contains thread local data.  */
-#define SEC_THREAD_LOCAL 0x1000
+#define SEC_THREAD_LOCAL 0x400
 
   /* The section has GOT references.  This flag is only for the
      linker, and is currently only used by the elf32-hppa back end.
@@ -1134,46 +1117,46 @@ typedef struct bfd_section
      in this section, which indicate to the linker that the section
      contains PIC code, and must be handled specially when doing a
      static link.  */
-#define SEC_HAS_GOT_REF 0x4000
+#define SEC_HAS_GOT_REF 0x800
 
   /* The section contains common symbols (symbols may be defined
      multiple times, the value of a symbol is the amount of
      space it requires, and the largest symbol value is the one
      used).  Most targets have exactly one of these (which we
      translate to bfd_com_section_ptr), but ECOFF has two.  */
-#define SEC_IS_COMMON 0x8000
+#define SEC_IS_COMMON 0x1000
 
   /* The section contains only debugging information.  For
      example, this is set for ELF .debug and .stab sections.
      strip tests this flag to see if a section can be
      discarded.  */
-#define SEC_DEBUGGING 0x10000
+#define SEC_DEBUGGING 0x2000
 
   /* The contents of this section are held in memory pointed to
      by the contents field.  This is checked by bfd_get_section_contents,
      and the data is retrieved from memory if appropriate.  */
-#define SEC_IN_MEMORY 0x20000
+#define SEC_IN_MEMORY 0x4000
 
   /* The contents of this section are to be excluded by the
      linker for executable and shared objects unless those
      objects are to be further relocated.  */
-#define SEC_EXCLUDE 0x40000
+#define SEC_EXCLUDE 0x8000
 
   /* The contents of this section are to be sorted based on the sum of
      the symbol and addend values specified by the associated relocation
      entries.  Entries without associated relocation entries will be
      appended to the end of the section in an unspecified order.  */
-#define SEC_SORT_ENTRIES 0x80000
+#define SEC_SORT_ENTRIES 0x10000
 
   /* When linking, duplicate sections of the same name should be
      discarded, rather than being combined into a single section as
      is usually done.  This is similar to how common symbols are
      handled.  See SEC_LINK_DUPLICATES below.  */
-#define SEC_LINK_ONCE 0x100000
+#define SEC_LINK_ONCE 0x20000
 
   /* If SEC_LINK_ONCE is set, this bitfield describes how the linker
      should handle duplicate sections.  */
-#define SEC_LINK_DUPLICATES 0x600000
+#define SEC_LINK_DUPLICATES 0x40000
 
   /* This value for SEC_LINK_DUPLICATES means that duplicate
      sections with the same name should simply be discarded.  */
@@ -1182,55 +1165,69 @@ typedef struct bfd_section
   /* This value for SEC_LINK_DUPLICATES means that the linker
      should warn if there are any duplicate sections, although
      it should still only link one copy.  */
-#define SEC_LINK_DUPLICATES_ONE_ONLY 0x200000
+#define SEC_LINK_DUPLICATES_ONE_ONLY 0x80000
 
   /* This value for SEC_LINK_DUPLICATES means that the linker
      should warn if any duplicate sections are a different size.  */
-#define SEC_LINK_DUPLICATES_SAME_SIZE 0x400000
+#define SEC_LINK_DUPLICATES_SAME_SIZE 0x100000
 
   /* This value for SEC_LINK_DUPLICATES means that the linker
      should warn if any duplicate sections contain different
      contents.  */
-#define SEC_LINK_DUPLICATES_SAME_CONTENTS 0x600000
+#define SEC_LINK_DUPLICATES_SAME_CONTENTS \
+  (SEC_LINK_DUPLICATES_ONE_ONLY | SEC_LINK_DUPLICATES_SAME_SIZE)
 
   /* This section was created by the linker as part of dynamic
      relocation or other arcane processing.  It is skipped when
      going through the first-pass output, trusting that someone
      else up the line will take care of it later.  */
-#define SEC_LINKER_CREATED 0x800000
+#define SEC_LINKER_CREATED 0x200000
 
   /* This section should not be subject to garbage collection.  */
-#define SEC_KEEP 0x1000000
+#define SEC_KEEP 0x400000
 
   /* This section contains "short" data, and should be placed
      "near" the GP.  */
-#define SEC_SMALL_DATA 0x2000000
-
-  /* This section contains data which may be shared with other
-     executables or shared objects.  */
-#define SEC_SHARED 0x4000000
-
-  /* When a section with this flag is being linked, then if the size of
-     the input section is less than a page, it should not cross a page
-     boundary.  If the size of the input section is one page or more, it
-     should be aligned on a page boundary.  */
-#define SEC_BLOCK 0x8000000
-
-  /* Conditionally link this section; do not link if there are no
-     references found to any symbol in the section.  */
-#define SEC_CLINK 0x10000000
+#define SEC_SMALL_DATA 0x800000
 
   /* Attempt to merge identical entities in the section.
      Entity size is given in the entsize field.  */
-#define SEC_MERGE 0x20000000
+#define SEC_MERGE 0x1000000
 
   /* If given with SEC_MERGE, entities to merge are zero terminated
      strings where entsize specifies character size instead of fixed
      size entries.  */
-#define SEC_STRINGS 0x40000000
+#define SEC_STRINGS 0x2000000
 
   /* This section contains data about section groups.  */
-#define SEC_GROUP 0x80000000
+#define SEC_GROUP 0x4000000
+
+  /* The section is a COFF shared library section.  This flag is
+     only for the linker.  If this type of section appears in
+     the input file, the linker must copy it to the output file
+     without changing the vma or size.  FIXME: Although this
+     was originally intended to be general, it really is COFF
+     specific (and the flag was renamed to indicate this).  It
+     might be cleaner to have some more general mechanism to
+     allow the back end to control what the linker does with
+     sections.  */
+#define SEC_COFF_SHARED_LIBRARY 0x10000000
+
+  /* This section contains data which may be shared with other
+     executables or shared objects. This is for COFF only.  */
+#define SEC_COFF_SHARED 0x20000000
+
+  /* When a section with this flag is being linked, then if the size of
+     the input section is less than a page, it should not cross a page
+     boundary.  If the size of the input section is one page or more,
+     it should be aligned on a page boundary.  This is for TI
+     TMS320C54X only.  */
+#define SEC_TIC54X_BLOCK 0x40000000
+
+  /* Conditionally link this section; do not link if there are no
+     references found to any symbol in the section.  This is for TI
+     TMS320C54X only.  */
+#define SEC_TIC54X_CLINK 0x80000000
 
   /*  End of section flags.  */
 
index 589b855..fd37435 100644 (file)
@@ -494,12 +494,12 @@ sec_to_styp_flags (sec_name, sec_flags)
     }
 
 #ifdef STYP_CLINK
-  if (sec_flags & SEC_CLINK)
+  if (sec_flags & SEC_TIC54X_CLINK)
     styp_flags |= STYP_CLINK;
 #endif
 
 #ifdef STYP_BLOCK
-  if (sec_flags & SEC_BLOCK)
+  if (sec_flags & SEC_TIC54X_BLOCK)
     styp_flags |= STYP_BLOCK;
 #endif
 
@@ -579,7 +579,7 @@ sec_to_styp_flags (sec_name, sec_flags)
     styp_flags |= IMAGE_SCN_MEM_WRITE;    /* Invert READONLY for write.  */
   if (sec_flags & SEC_CODE)
     styp_flags |= IMAGE_SCN_MEM_EXECUTE;  /* CODE->EXECUTE.  */
-  if (sec_flags & SEC_SHARED)
+  if (sec_flags & SEC_COFF_SHARED)
     styp_flags |= IMAGE_SCN_MEM_SHARED;   /* Shared remains meaningful.  */
 
   return styp_flags;
@@ -608,12 +608,12 @@ styp_to_sec_flags (abfd, hdr, name, section, flags_ptr)
 
 #ifdef STYP_BLOCK
   if (styp_flags & STYP_BLOCK)
-    sec_flags |= SEC_BLOCK;
+    sec_flags |= SEC_TIC54X_BLOCK;
 #endif
 
 #ifdef STYP_CLINK
   if (styp_flags & STYP_CLINK)
-    sec_flags |= SEC_CLINK;
+    sec_flags |= SEC_TIC54X_CLINK;
 #endif
 
 #ifdef STYP_NOLOAD
@@ -1086,7 +1086,7 @@ styp_to_sec_flags (abfd, hdr, name, section, flags_ptr)
            sec_flags |= SEC_DEBUGGING;
          break;
        case IMAGE_SCN_MEM_SHARED:
-         sec_flags |= SEC_SHARED;
+         sec_flags |= SEC_COFF_SHARED;
          break;
        case IMAGE_SCN_LNK_REMOVE:
          sec_flags |= SEC_EXCLUDE;
index e4ba6ae..09b9eee 100644 (file)
@@ -641,7 +641,7 @@ const bfd_target TARGET_BIG_SYM =
   /* section_flags: mask of all section flags */
   (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_READONLY
    | SEC_CODE | SEC_DATA | SEC_DEBUGGING | SEC_EXCLUDE | SEC_SORT_ENTRIES
-   | SEC_ARCH_BIT_0 | SEC_SMALL_DATA | SEC_MERGE | SEC_STRINGS | SEC_GROUP),
+   | SEC_SMALL_DATA | SEC_MERGE | SEC_STRINGS | SEC_GROUP),
 
    /* leading_symbol_char: is the first char of a user symbol
       predictable, and if so what is it */
@@ -737,7 +737,7 @@ const bfd_target TARGET_LITTLE_SYM =
   /* section_flags: mask of all section flags */
   (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_READONLY
    | SEC_CODE | SEC_DATA | SEC_DEBUGGING | SEC_EXCLUDE | SEC_SORT_ENTRIES
-   | SEC_ARCH_BIT_0 | SEC_SMALL_DATA | SEC_MERGE | SEC_STRINGS | SEC_GROUP),
+   | SEC_SMALL_DATA | SEC_MERGE | SEC_STRINGS | SEC_GROUP),
 
    /* leading_symbol_char: is the first char of a user symbol
       predictable, and if so what is it */
index 72ffcd5..2f60171 100644 (file)
@@ -183,23 +183,17 @@ CODE_FRAGMENT
 .     some relocation information too.  *}
 .#define SEC_RELOC      0x004
 .
-.  {* ELF reserves 4 processor specific bits and 8 operating system
-.     specific bits in sh_flags; at present we can get away with just
-.     one in communicating between the assembler and BFD, but this
-.     isn't a good long-term solution.  *}
-.#define SEC_ARCH_BIT_0 0x008
-.
 .  {* A signal to the OS that the section contains read only data.  *}
-.#define SEC_READONLY   0x010
+.#define SEC_READONLY   0x008
 .
 .  {* The section contains code only.  *}
-.#define SEC_CODE       0x020
+.#define SEC_CODE       0x010
 .
 .  {* The section contains data only.  *}
-.#define SEC_DATA       0x040
+.#define SEC_DATA       0x020
 .
 .  {* The section will reside in ROM.  *}
-.#define SEC_ROM        0x080
+.#define SEC_ROM        0x040
 .
 .  {* The section contains constructor information. This section
 .     type is used by the linker to create lists of constructors and
@@ -211,30 +205,19 @@ CODE_FRAGMENT
 .     sections called <<__CTOR_LIST__>> and relocate the data
 .     contained within - exactly the operations it would peform on
 .     standard data.  *}
-.#define SEC_CONSTRUCTOR 0x100
+.#define SEC_CONSTRUCTOR 0x080
 .
 .  {* The section has contents - a data section could be
 .     <<SEC_ALLOC>> | <<SEC_HAS_CONTENTS>>; a debug section could be
 .     <<SEC_HAS_CONTENTS>>  *}
-.#define SEC_HAS_CONTENTS 0x200
+.#define SEC_HAS_CONTENTS 0x100
 .
 .  {* An instruction to the linker to not output the section
 .     even if it has information which would normally be written.  *}
-.#define SEC_NEVER_LOAD 0x400
-.
-.  {* The section is a COFF shared library section.  This flag is
-.     only for the linker.  If this type of section appears in
-.     the input file, the linker must copy it to the output file
-.     without changing the vma or size.  FIXME: Although this
-.     was originally intended to be general, it really is COFF
-.     specific (and the flag was renamed to indicate this).  It
-.     might be cleaner to have some more general mechanism to
-.     allow the back end to control what the linker does with
-.     sections.  *}
-.#define SEC_COFF_SHARED_LIBRARY 0x800
+.#define SEC_NEVER_LOAD 0x200
 .
 .  {* The section contains thread local data.  *}
-.#define SEC_THREAD_LOCAL 0x1000
+.#define SEC_THREAD_LOCAL 0x400
 .
 .  {* The section has GOT references.  This flag is only for the
 .     linker, and is currently only used by the elf32-hppa back end.
@@ -242,46 +225,46 @@ CODE_FRAGMENT
 .     in this section, which indicate to the linker that the section
 .     contains PIC code, and must be handled specially when doing a
 .     static link.  *}
-.#define SEC_HAS_GOT_REF 0x4000
+.#define SEC_HAS_GOT_REF 0x800
 .
 .  {* The section contains common symbols (symbols may be defined
 .     multiple times, the value of a symbol is the amount of
 .     space it requires, and the largest symbol value is the one
 .     used).  Most targets have exactly one of these (which we
 .     translate to bfd_com_section_ptr), but ECOFF has two.  *}
-.#define SEC_IS_COMMON 0x8000
+.#define SEC_IS_COMMON 0x1000
 .
 .  {* The section contains only debugging information.  For
 .     example, this is set for ELF .debug and .stab sections.
 .     strip tests this flag to see if a section can be
 .     discarded.  *}
-.#define SEC_DEBUGGING 0x10000
+.#define SEC_DEBUGGING 0x2000
 .
 .  {* The contents of this section are held in memory pointed to
 .     by the contents field.  This is checked by bfd_get_section_contents,
 .     and the data is retrieved from memory if appropriate.  *}
-.#define SEC_IN_MEMORY 0x20000
+.#define SEC_IN_MEMORY 0x4000
 .
 .  {* The contents of this section are to be excluded by the
 .     linker for executable and shared objects unless those
 .     objects are to be further relocated.  *}
-.#define SEC_EXCLUDE 0x40000
+.#define SEC_EXCLUDE 0x8000
 .
 .  {* The contents of this section are to be sorted based on the sum of
 .     the symbol and addend values specified by the associated relocation
 .     entries.  Entries without associated relocation entries will be
 .     appended to the end of the section in an unspecified order.  *}
-.#define SEC_SORT_ENTRIES 0x80000
+.#define SEC_SORT_ENTRIES 0x10000
 .
 .  {* When linking, duplicate sections of the same name should be
 .     discarded, rather than being combined into a single section as
 .     is usually done.  This is similar to how common symbols are
 .     handled.  See SEC_LINK_DUPLICATES below.  *}
-.#define SEC_LINK_ONCE 0x100000
+.#define SEC_LINK_ONCE 0x20000
 .
 .  {* If SEC_LINK_ONCE is set, this bitfield describes how the linker
 .     should handle duplicate sections.  *}
-.#define SEC_LINK_DUPLICATES 0x600000
+.#define SEC_LINK_DUPLICATES 0x40000
 .
 .  {* This value for SEC_LINK_DUPLICATES means that duplicate
 .     sections with the same name should simply be discarded.  *}
@@ -290,55 +273,69 @@ CODE_FRAGMENT
 .  {* This value for SEC_LINK_DUPLICATES means that the linker
 .     should warn if there are any duplicate sections, although
 .     it should still only link one copy.  *}
-.#define SEC_LINK_DUPLICATES_ONE_ONLY 0x200000
+.#define SEC_LINK_DUPLICATES_ONE_ONLY 0x80000
 .
 .  {* This value for SEC_LINK_DUPLICATES means that the linker
 .     should warn if any duplicate sections are a different size.  *}
-.#define SEC_LINK_DUPLICATES_SAME_SIZE 0x400000
+.#define SEC_LINK_DUPLICATES_SAME_SIZE 0x100000
 .
 .  {* This value for SEC_LINK_DUPLICATES means that the linker
 .     should warn if any duplicate sections contain different
 .     contents.  *}
-.#define SEC_LINK_DUPLICATES_SAME_CONTENTS 0x600000
+.#define SEC_LINK_DUPLICATES_SAME_CONTENTS \
+.  (SEC_LINK_DUPLICATES_ONE_ONLY | SEC_LINK_DUPLICATES_SAME_SIZE)
 .
 .  {* This section was created by the linker as part of dynamic
 .     relocation or other arcane processing.  It is skipped when
 .     going through the first-pass output, trusting that someone
 .     else up the line will take care of it later.  *}
-.#define SEC_LINKER_CREATED 0x800000
+.#define SEC_LINKER_CREATED 0x200000
 .
 .  {* This section should not be subject to garbage collection.  *}
-.#define SEC_KEEP 0x1000000
+.#define SEC_KEEP 0x400000
 .
 .  {* This section contains "short" data, and should be placed
 .     "near" the GP.  *}
-.#define SEC_SMALL_DATA 0x2000000
-.
-.  {* This section contains data which may be shared with other
-.     executables or shared objects.  *}
-.#define SEC_SHARED 0x4000000
-.
-.  {* When a section with this flag is being linked, then if the size of
-.     the input section is less than a page, it should not cross a page
-.     boundary.  If the size of the input section is one page or more, it
-.     should be aligned on a page boundary.  *}
-.#define SEC_BLOCK 0x8000000
-.
-.  {* Conditionally link this section; do not link if there are no
-.     references found to any symbol in the section.  *}
-.#define SEC_CLINK 0x10000000
+.#define SEC_SMALL_DATA 0x800000
 .
 .  {* Attempt to merge identical entities in the section.
 .     Entity size is given in the entsize field.  *}
-.#define SEC_MERGE 0x20000000
+.#define SEC_MERGE 0x1000000
 .
 .  {* If given with SEC_MERGE, entities to merge are zero terminated
 .     strings where entsize specifies character size instead of fixed
 .     size entries.  *}
-.#define SEC_STRINGS 0x40000000
+.#define SEC_STRINGS 0x2000000
 .
 .  {* This section contains data about section groups.  *}
-.#define SEC_GROUP 0x80000000
+.#define SEC_GROUP 0x4000000
+.
+.  {* The section is a COFF shared library section.  This flag is
+.     only for the linker.  If this type of section appears in
+.     the input file, the linker must copy it to the output file
+.     without changing the vma or size.  FIXME: Although this
+.     was originally intended to be general, it really is COFF
+.     specific (and the flag was renamed to indicate this).  It
+.     might be cleaner to have some more general mechanism to
+.     allow the back end to control what the linker does with
+.     sections.  *}
+.#define SEC_COFF_SHARED_LIBRARY 0x10000000
+.
+.  {* This section contains data which may be shared with other
+.     executables or shared objects. This is for COFF only.  *}
+.#define SEC_COFF_SHARED 0x20000000
+.
+.  {* When a section with this flag is being linked, then if the size of
+.     the input section is less than a page, it should not cross a page
+.     boundary.  If the size of the input section is one page or more,
+.     it should be aligned on a page boundary.  This is for TI
+.     TMS320C54X only.  *}
+.#define SEC_TIC54X_BLOCK 0x40000000
+.
+.  {* Conditionally link this section; do not link if there are no
+.     references found to any symbol in the section.  This is for TI
+.     TMS320C54X only.  *}
+.#define SEC_TIC54X_CLINK 0x80000000
 .
 .  {*  End of section flags.  *}
 .
index ff3a708..19cec9d 100644 (file)
@@ -1,3 +1,12 @@
+2005-02-21  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * objcopy.c (parse_flags): Replace SEC_SHARED with
+       SEC_COFF_SHARED.
+
+       * objdump.c (dump_section_header): Dump SEC_TIC54X_BLOCK and
+       SEC_TIC54X_CLINK for TI c54x only. Remove SEC_ARCH_BIT_0. Dump
+       SEC_COFF_SHARED for COFF only.
+
 2005-02-21  Alan Modra  <amodra@bigpond.net.au>
 
        * Makefile.am: Run "make dep-am"
index c516f79..d58e12e 100644 (file)
@@ -547,7 +547,7 @@ parse_flags (const char *s)
       PARSE_FLAG ("code", SEC_CODE);
       PARSE_FLAG ("data", SEC_DATA);
       PARSE_FLAG ("rom", SEC_ROM);
-      PARSE_FLAG ("share", SEC_SHARED);
+      PARSE_FLAG ("share", SEC_COFF_SHARED);
       PARSE_FLAG ("contents", SEC_HAS_CONTENTS);
 #undef PARSE_FLAG
       else
index 7249054..01e6198 100644 (file)
@@ -290,7 +290,7 @@ nonfatal (const char *msg)
 }
 \f
 static void
-dump_section_header (bfd *abfd ATTRIBUTE_UNUSED, asection *section,
+dump_section_header (bfd *abfd, asection *section,
                     void *ignored ATTRIBUTE_UNUSED)
 {
   char *comma = "";
@@ -324,11 +324,14 @@ dump_section_header (bfd *abfd ATTRIBUTE_UNUSED, asection *section,
   PF (SEC_NEVER_LOAD, "NEVER_LOAD");
   PF (SEC_EXCLUDE, "EXCLUDE");
   PF (SEC_SORT_ENTRIES, "SORT_ENTRIES");
-  PF (SEC_BLOCK, "BLOCK");
-  PF (SEC_CLINK, "CLINK");
+  if (bfd_get_arch (abfd) == bfd_arch_tic54x)
+    {
+      PF (SEC_TIC54X_BLOCK, "BLOCK");
+      PF (SEC_TIC54X_CLINK, "CLINK");
+    }
   PF (SEC_SMALL_DATA, "SMALL_DATA");
-  PF (SEC_SHARED, "SHARED");
-  PF (SEC_ARCH_BIT_0, "ARCH_BIT_0");
+  if (bfd_get_flavour (abfd) == bfd_target_coff_flavour)
+    PF (SEC_COFF_SHARED, "SHARED");
   PF (SEC_THREAD_LOCAL, "THREAD_LOCAL");
 
   if ((section->flags & SEC_LINK_ONCE) != 0)
index 7abba5e..387bf39 100644 (file)
@@ -1,3 +1,14 @@
+2005-02-21  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * config/obj-coff.c (obj_coff_section): Replace SEC_SHARED with
+       SEC_COFF_SHARED.
+
+       * config/tc-tic54x.c (tic54x_bss): Replace SEC_BLOCK with
+       SEC_TIC54X_BLOCK.
+       (demand_empty_rest_of_line): Likewise.
+       (tic54x_sblock): Likewise.
+       (tic54x_clink): Replace with SEC_CLINK with SEC_TIC54X_CLINK.
+
 2005-02-21  Alan Modra  <amodra@bigpond.net.au>
 
        * read.c (address_bytes): New function.
index 69b53ff..d54c684 100644 (file)
@@ -1607,7 +1607,7 @@ obj_coff_section (ignore)
                case 'b': flags |= SEC_ALLOC; flags &=~ SEC_LOAD; break;
                case 'n': flags &=~ SEC_LOAD; flags |= SEC_NEVER_LOAD; break;
 
-               case 's': flags |= SEC_SHARED; /* fall through */
+               case 's': flags |= SEC_COFF_SHARED; /* fall through */
                case 'd': flags |= SEC_DATA | SEC_LOAD; /* fall through */
                case 'w': flags &=~ SEC_READONLY; break;
 
@@ -1662,7 +1662,7 @@ obj_coff_section (ignore)
       /* This section's attributes have already been set. Warn if the
          attributes don't match.  */
       flagword matchflags = (SEC_ALLOC | SEC_LOAD | SEC_READONLY | SEC_CODE
-                            | SEC_DATA | SEC_SHARED | SEC_NEVER_LOAD);
+                            | SEC_DATA | SEC_COFF_SHARED | SEC_NEVER_LOAD);
       if ((flags ^ oldflags) & matchflags)
        as_warn (_("Ignoring changed section attributes for %s"), name);
     }
index 175fab2..0a18756 100644 (file)
@@ -661,7 +661,7 @@ tic54x_bss (x)
     }
 
   if (block)
-    bss_section->flags |= SEC_BLOCK;
+    bss_section->flags |= SEC_TIC54X_BLOCK;
 
   subseg_set (current_seg, current_subseg);    /* Restore current seg.  */
   demand_empty_rest_of_line ();
@@ -1574,7 +1574,7 @@ tic54x_usect (x)
   *p = 0;
 
   if (blocking_flag)
-    flags |= SEC_BLOCK;
+    flags |= SEC_TIC54X_BLOCK;
 
   if (!bfd_set_section_flags (stdoutput, seg, flags))
     as_warn ("Error setting flags for \"%s\": %s", name,
@@ -2014,7 +2014,7 @@ tic54x_clink (ignored)
        }
     }
 
-  seg->flags |= SEC_CLINK;
+  seg->flags |= SEC_TIC54X_CLINK;
 
   demand_empty_rest_of_line ();
 }
@@ -2325,7 +2325,7 @@ tic54x_sblock (ignore)
          ignore_rest_of_line ();
          return;
        }
-      seg->flags |= SEC_BLOCK;
+      seg->flags |= SEC_TIC54X_BLOCK;
 
       c = *input_line_pointer;
       if (!is_end_of_line[(int) c])
index ec36b3b..598253d 100644 (file)
@@ -1,3 +1,10 @@
+2005-02-21  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * ldlang.c (lang_add_section): Check SEC_TIC54X_BLOCK for TI
+       tic54x input only.
+       (lang_size_sections_1): Check SEC_COFF_SHARED_LIBRARY for COFF
+       and ECOFF output only.
+
 2005-02-21  Alan Modra  <amodra@bigpond.net.au>
 
        * config.in: Regenerate.
index b33ee15..878e15f 100644 (file)
@@ -1413,9 +1413,10 @@ lang_add_section (lang_statement_list_type *ptr,
       if (output->section_alignment != -1)
        output->bfd_section->alignment_power = output->section_alignment;
 
-      if (section->flags & SEC_BLOCK)
+      if (bfd_get_arch (section->owner) == bfd_arch_tic54x
+         && (section->flags & SEC_TIC54X_BLOCK) != 0)
        {
-         output->bfd_section->flags |= SEC_BLOCK;
+         output->bfd_section->flags |= SEC_TIC54X_BLOCK;
          /* FIXME: This value should really be obtained from the bfd...  */
          output->block_value = 128;
        }
@@ -3424,7 +3425,9 @@ lang_size_sections_1
               address from the input section.  FIXME: This is COFF
               specific; it would be cleaner if there were some other way
               to do this, but nothing simple comes to mind.  */
-           if ((os->bfd_section->flags & SEC_COFF_SHARED_LIBRARY) != 0)
+           if ((bfd_get_flavour (output_bfd) == bfd_target_ecoff_flavour
+                || bfd_get_flavour (output_bfd) == bfd_target_coff_flavour)
+               && (os->bfd_section->flags & SEC_COFF_SHARED_LIBRARY) != 0)
              {
                asection *input;