This is the mail archive of the binutils@sources.redhat.com 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]

Re: "Warning: size of symbol FOO changed from X to Y in OBJ"


Hi Ian,  Hi H.J.

  OK I have two patches for this.  The first one changes
  load_symbols() in the linker so that it becomes a boolean function
  and can return a failure from the bfd routines back to its parent.

  The second patch changes styp_to_sec_flags() to return a boolean,
  and changes make_a_section_from_file() to examine this return value.

  Rather than just apply them though, I am posting them first in case
  anybody wants to review or comment on them.  If I do not hear
  anything then I will just check them in.

Cheers
        Nick

ld/ChangeLog
2001-06-12  Nick Clifton  <nickc@cambridge.redhat.com>

	* ldlang.c (walk_wild): Only call walk_wild_file if
	lookup_name returns something.
        (lookup_name): If load_symbols fails, return NULL.
        (load_symbols): Chnage to a boolean function.
        (open_input_bfds): If load_symbols fails then do not make the
	executable.

bfd/ChangeLog
2001-06-12  Nick Clifton  <nickc@cambridge.redhat.com>

	* coffcode.h (styp_flags_to_sec_flags): Change to a boolean
	function.  Move flagword result into parameter list.  Remove
	comment about setting bfd_error_handler to intercept failure
	results.
        * coffgen.c (make_a_section_from_file): Examine result of
	calling bfd_coff_styp_to_sec_flags and pass a failure back to
	caller.
        * ecoff.h (styp_flags_to_sec_flags): Change to a boolean
	function.  Move flagword result into parameter list.
        * libcoff.h: Regenerate.
        * libecoff.h: Regenerate.

Index: ld/ldlang.c
===================================================================
RCS file: /cvs/src/src/ld/ldlang.c,v
retrieving revision 1.49
diff -p -r1.49 ldlang.c
*** ldlang.c	2001/06/08 01:58:20	1.49
--- ldlang.c	2001/06/12 17:25:03
*************** static void output_section_callback
*** 84,90 ****
    PARAMS ((lang_wild_statement_type *, asection *,
  	   lang_input_statement_type *, PTR));
  static lang_input_statement_type *lookup_name PARAMS ((const char *));
! static void load_symbols
    PARAMS ((lang_input_statement_type *, lang_statement_list_type *));
  static void wild
    PARAMS ((lang_wild_statement_type *, const char *, const char *,
--- 84,90 ----
    PARAMS ((lang_wild_statement_type *, asection *,
  	   lang_input_statement_type *, PTR));
  static lang_input_statement_type *lookup_name PARAMS ((const char *));
! static boolean load_symbols
    PARAMS ((lang_input_statement_type *, lang_statement_list_type *));
  static void wild
    PARAMS ((lang_wild_statement_type *, const char *, const char *,
*************** walk_wild (s, section, file, callback, d
*** 360,366 ****
  
        /* Perform the iteration over a single file.  */
        f = lookup_name (file);
!       walk_wild_file (s, section, f, callback, data);
      }
  }
  
--- 360,367 ----
  
        /* Perform the iteration over a single file.  */
        f = lookup_name (file);
!       if (f)
! 	walk_wild_file (s, section, f, callback, data);
      }
  }
  
*************** lookup_name (name)
*** 1425,1438 ****
        || search->filename == (const char *) NULL)
      return search;
  
!   load_symbols (search, (lang_statement_list_type *) NULL);
  
    return search;
  }
  
  /* Get the symbols for an input file.  */
  
! static void
  load_symbols (entry, place)
       lang_input_statement_type *entry;
       lang_statement_list_type *place;
--- 1426,1440 ----
        || search->filename == (const char *) NULL)
      return search;
  
!   if (! load_symbols (search, (lang_statement_list_type *) NULL))
!     return NULL;
  
    return search;
  }
  
  /* Get the symbols for an input file.  */
  
! static boolean
  load_symbols (entry, place)
       lang_input_statement_type *entry;
       lang_statement_list_type *place;
*************** load_symbols (entry, place)
*** 1440,1446 ****
    char **matching;
  
    if (entry->loaded)
!     return;
  
    ldfile_open_file (entry);
  
--- 1442,1448 ----
    char **matching;
  
    if (entry->loaded)
!     return true;
  
    ldfile_open_file (entry);
  
*************** load_symbols (entry, place)
*** 1449,1460 ****
      {
        bfd_error_type err;
        lang_statement_list_type *hold;
! 
        err = bfd_get_error ();
  
        /* See if the emulation has some special knowledge.  */
        if (ldemul_unrecognized_file (entry))
! 	return;
  
        if (err == bfd_error_file_ambiguously_recognized)
  	{
--- 1451,1463 ----
      {
        bfd_error_type err;
        lang_statement_list_type *hold;
!       boolean bad_load = true;
!       
        err = bfd_get_error ();
  
        /* See if the emulation has some special knowledge.  */
        if (ldemul_unrecognized_file (entry))
! 	return true;
  
        if (err == bfd_error_file_ambiguously_recognized)
  	{
*************** load_symbols (entry, place)
*** 1468,1475 ****
  	}
        else if (err != bfd_error_file_not_recognized
  	       || place == NULL)
! 	einfo (_("%F%B: file not recognized: %E\n"), entry->the_bfd);
! 
        bfd_close (entry->the_bfd);
        entry->the_bfd = NULL;
  
--- 1471,1480 ----
  	}
        else if (err != bfd_error_file_not_recognized
  	       || place == NULL)
! 	  einfo (_("%F%B: file not recognized: %E\n"), entry->the_bfd);
!       else
! 	bad_load = false;
!       
        bfd_close (entry->the_bfd);
        entry->the_bfd = NULL;
  
*************** load_symbols (entry, place)
*** 1486,1496 ****
  
        stat_ptr = hold;
  
!       return;
      }
  
    if (ldemul_recognized_file (entry))
!     return;
  
    /* We don't call ldlang_add_file for an archive.  Instead, the
       add_symbols entry point will call ldlang_add_file, via the
--- 1491,1501 ----
  
        stat_ptr = hold;
  
!       return ! bad_load;
      }
  
    if (ldemul_recognized_file (entry))
!     return true;
  
    /* We don't call ldlang_add_file for an archive.  Instead, the
       add_symbols entry point will call ldlang_add_file, via the
*************** load_symbols (entry, place)
*** 1510,1541 ****
      case bfd_archive:
        if (entry->whole_archive)
  	{
! 	  bfd *member = bfd_openr_next_archived_file (entry->the_bfd,
! 						      (bfd *) NULL);
! 	  while (member != NULL)
  	    {
  	      if (! bfd_check_format (member, bfd_object))
! 		einfo (_("%F%B: object %B in archive is not object\n"),
! 		       entry->the_bfd, member);
  	      if (! ((*link_info.callbacks->add_archive_element)
  		     (&link_info, member, "--whole-archive")))
  		abort ();
  	      if (! bfd_link_add_symbols (member, &link_info))
! 		einfo (_("%F%B: could not read symbols: %E\n"), member);
! 	      member = bfd_openr_next_archived_file (entry->the_bfd,
! 						     member);
  	    }
- 
- 	  entry->loaded = true;
  
! 	  return;
  	}
      }
  
!   if (! bfd_link_add_symbols (entry->the_bfd, &link_info))
      einfo (_("%F%B: could not read symbols: %E\n"), entry->the_bfd);
  
!   entry->loaded = true;
  }
  
  /* Handle a wild statement.  SECTION or FILE or both may be NULL,
--- 1515,1560 ----
      case bfd_archive:
        if (entry->whole_archive)
  	{
! 	  bfd * member = NULL;
! 	  boolean loaded = true;
! 
! 	  for (;;)
  	    {
+ 	      member = bfd_openr_next_archived_file (entry->the_bfd, member);
+ 
+ 	      if (member == NULL)
+ 		break;
+ 	      
  	      if (! bfd_check_format (member, bfd_object))
! 		{
! 		  einfo (_("%F%B: member %B in archive is not an object\n"),
! 			 entry->the_bfd, member);
! 		  loaded = false;
! 		}
! 
  	      if (! ((*link_info.callbacks->add_archive_element)
  		     (&link_info, member, "--whole-archive")))
  		abort ();
+ 
  	      if (! bfd_link_add_symbols (member, &link_info))
! 		{
! 		  einfo (_("%F%B: could not read symbols: %E\n"), member);
! 		  loaded = false;
! 		}
  	    }
  
! 	  entry->loaded = loaded;
! 	  return loaded;
  	}
+       break;
      }
  
!   if (bfd_link_add_symbols (entry->the_bfd, &link_info))
!     entry->loaded = true;
!   else
      einfo (_("%F%B: could not read symbols: %E\n"), entry->the_bfd);
  
!   return entry->loaded;
  }
  
  /* Handle a wild statement.  SECTION or FILE or both may be NULL,
*************** open_input_bfds (s, force)
*** 1929,1935 ****
  
  	      lang_list_init (&add);
  
! 	      load_symbols (&s->input_statement, &add);
  
  	      if (add.head != NULL)
  		{
--- 1948,1955 ----
  
  	      lang_list_init (&add);
  
! 	      if (! load_symbols (&s->input_statement, &add))
! 		config.make_executable = false;
  
  	      if (add.head != NULL)
  		{

Index: bfd/coffcode.h
===================================================================
RCS file: /cvs/src/src/bfd/coffcode.h,v
retrieving revision 1.58
diff -p -r1.58 coffcode.h
*** coffcode.h	2001/05/24 20:50:50	1.58
--- coffcode.h	2001/06/12 17:26:00
*************** CODE_FRAGMENT
*** 312,319 ****
  #define STRING_SIZE_SIZE (4)
  
  static long sec_to_styp_flags PARAMS ((const char *, flagword));
! static flagword styp_to_sec_flags
!   PARAMS ((bfd *, PTR, const char *, asection *));
  static boolean coff_bad_format_hook PARAMS ((bfd *, PTR));
  static void coff_set_custom_section_alignment
    PARAMS ((bfd *, asection *, const struct coff_section_alignment_entry *,
--- 312,319 ----
  #define STRING_SIZE_SIZE (4)
  
  static long sec_to_styp_flags PARAMS ((const char *, flagword));
! static boolean styp_to_sec_flags
!   PARAMS ((bfd *, PTR, const char *, asection *, flagword *));
  static boolean coff_bad_format_hook PARAMS ((bfd *, PTR));
  static void coff_set_custom_section_alignment
    PARAMS ((bfd *, asection *, const struct coff_section_alignment_entry *,
*************** sec_to_styp_flags (sec_name, sec_flags)
*** 553,564 ****
  
  #ifndef COFF_WITH_PE
  
! static flagword
! styp_to_sec_flags (abfd, hdr, name, section)
       bfd *abfd ATTRIBUTE_UNUSED;
       PTR hdr;
       const char *name;
       asection *section ATTRIBUTE_UNUSED;
  {
    struct internal_scnhdr *internal_s = (struct internal_scnhdr *) hdr;
    long styp_flags = internal_s->s_flags;
--- 553,565 ----
  
  #ifndef COFF_WITH_PE
  
! static boolean
! styp_to_sec_flags (abfd, hdr, name, section, flags_ptr)
       bfd *abfd ATTRIBUTE_UNUSED;
       PTR hdr;
       const char *name;
       asection *section ATTRIBUTE_UNUSED;
+      flagword *flags_ptr;
  {
    struct internal_scnhdr *internal_s = (struct internal_scnhdr *) hdr;
    long styp_flags = internal_s->s_flags;
*************** styp_to_sec_flags (abfd, hdr, name, sect
*** 566,584 ****
  
  #ifdef STYP_BLOCK
    if (styp_flags & STYP_BLOCK)
!       sec_flags |= SEC_BLOCK;
  #endif
  
  #ifdef STYP_CLINK
    if (styp_flags & STYP_CLINK)
!       sec_flags |= SEC_CLINK;
  #endif
  
  #ifdef STYP_NOLOAD
    if (styp_flags & STYP_NOLOAD)
!     {
!       sec_flags |= SEC_NEVER_LOAD;
!     }
  #endif /* STYP_NOLOAD */
  
    /* For 386 COFF, at least, an unloadable text or data section is
--- 567,583 ----
  
  #ifdef STYP_BLOCK
    if (styp_flags & STYP_BLOCK)
!     sec_flags |= SEC_BLOCK;
  #endif
  
  #ifdef STYP_CLINK
    if (styp_flags & STYP_CLINK)
!     sec_flags |= SEC_CLINK;
  #endif
  
  #ifdef STYP_NOLOAD
    if (styp_flags & STYP_NOLOAD)
!     sec_flags |= SEC_NEVER_LOAD;
  #endif /* STYP_NOLOAD */
  
    /* For 386 COFF, at least, an unloadable text or data section is
*************** styp_to_sec_flags (abfd, hdr, name, sect
*** 619,627 ****
  #endif
      }
    else if (styp_flags & STYP_PAD)
!     {
!       sec_flags = 0;
!     }
    else if (strcmp (name, _TEXT) == 0)
      {
        if (sec_flags & SEC_NEVER_LOAD)
--- 618,624 ----
  #endif
      }
    else if (styp_flags & STYP_PAD)
!     sec_flags = 0;
    else if (strcmp (name, _TEXT) == 0)
      {
        if (sec_flags & SEC_NEVER_LOAD)
*************** styp_to_sec_flags (abfd, hdr, name, sect
*** 664,689 ****
  #endif
  #ifdef _LIT
    else if (strcmp (name, _LIT) == 0)
!     {
!       sec_flags = SEC_LOAD | SEC_ALLOC | SEC_READONLY;
!     }
  #endif
    else
!     {
!       sec_flags |= SEC_ALLOC | SEC_LOAD;
!     }
  
  #ifdef STYP_LIT			/* A29k readonly text/data section type */
    if ((styp_flags & STYP_LIT) == STYP_LIT)
!     {
!       sec_flags = (SEC_LOAD | SEC_ALLOC | SEC_READONLY);
!     }
  #endif /* STYP_LIT */
  #ifdef STYP_OTHER_LOAD		/* Other loaded sections */
    if (styp_flags & STYP_OTHER_LOAD)
!     {
!       sec_flags = (SEC_LOAD | SEC_ALLOC);
!     }
  #endif /* STYP_SDATA */
  
  #if defined (COFF_LONG_SECTION_NAMES) && defined (COFF_SUPPORT_GNU_LINKONCE)
--- 661,679 ----
  #endif
  #ifdef _LIT
    else if (strcmp (name, _LIT) == 0)
!     sec_flags = SEC_LOAD | SEC_ALLOC | SEC_READONLY;
  #endif
    else
!     sec_flags |= SEC_ALLOC | SEC_LOAD;
  
  #ifdef STYP_LIT			/* A29k readonly text/data section type */
    if ((styp_flags & STYP_LIT) == STYP_LIT)
!     sec_flags = (SEC_LOAD | SEC_ALLOC | SEC_READONLY);
  #endif /* STYP_LIT */
+ 
  #ifdef STYP_OTHER_LOAD		/* Other loaded sections */
    if (styp_flags & STYP_OTHER_LOAD)
!     sec_flags = (SEC_LOAD | SEC_ALLOC);
  #endif /* STYP_SDATA */
  
  #if defined (COFF_LONG_SECTION_NAMES) && defined (COFF_SUPPORT_GNU_LINKONCE)
*************** styp_to_sec_flags (abfd, hdr, name, sect
*** 697,703 ****
      sec_flags |= SEC_LINK_ONCE | SEC_LINK_DUPLICATES_DISCARD;
  #endif
  
!   return sec_flags;
  }
  
  #else /* COFF_WITH_PE */
--- 687,697 ----
      sec_flags |= SEC_LINK_ONCE | SEC_LINK_DUPLICATES_DISCARD;
  #endif
  
!   if (flags_ptr == NULL)
!     return false;
! 
!   * flags_ptr = sec_flags;
!   return true;
  }
  
  #else /* COFF_WITH_PE */
*************** handle_COMDAT (abfd, sec_flags, hdr, nam
*** 966,981 ****
     required information.  FIXME: Is the COMDAT symbol index used for
     any purpose other than objdump?  */
  
! static flagword
! styp_to_sec_flags (abfd, hdr, name, section)
       bfd *abfd;
       PTR hdr;
       const char *name;
       asection *section;
  {
    struct internal_scnhdr *internal_s = (struct internal_scnhdr *) hdr;
    long styp_flags = internal_s->s_flags;
    flagword sec_flags;
  
    /* Assume read only unless IMAGE_SCN_MEM_WRITE is specified.  */
    sec_flags = SEC_READONLY;
--- 960,977 ----
     required information.  FIXME: Is the COMDAT symbol index used for
     any purpose other than objdump?  */
  
! static boolean
! styp_to_sec_flags (abfd, hdr, name, section, flags_ptr)
       bfd *abfd;
       PTR hdr;
       const char *name;
       asection *section;
+      flagword *flags_ptr;
  {
    struct internal_scnhdr *internal_s = (struct internal_scnhdr *) hdr;
    long styp_flags = internal_s->s_flags;
    flagword sec_flags;
+   boolean result = true;
  
    /* Assume read only unless IMAGE_SCN_MEM_WRITE is specified.  */
    sec_flags = SEC_READONLY;
*************** styp_to_sec_flags (abfd, hdr, name, sect
*** 1070,1083 ****
  	  break;	  
  	}
  
!       /* If the section flag was not handled, report it here.  This will allow
! 	 users of the BFD library to report a problem but continue executing.
! 	 Tools which need to be aware of these problems (such as the linker)
! 	 can override the default bfd_error_handler to intercept these reports.  */
        if (unhandled != NULL)
! 	(*_bfd_error_handler)
! 	  (_("%s (%s): Section flag %s (0x%x) ignored"),
! 	   bfd_get_filename (abfd), name, unhandled, flag);
      }
  
  #if defined (COFF_LONG_SECTION_NAMES) && defined (COFF_SUPPORT_GNU_LINKONCE)
--- 1066,1079 ----
  	  break;	  
  	}
  
!       /* If the section flag was not handled, report it here.  */
        if (unhandled != NULL)
! 	{
! 	  (*_bfd_error_handler)
! 	    (_("%s (%s): Section flag %s (0x%x) ignored"),
! 	     bfd_get_filename (abfd), name, unhandled, flag);
! 	  result = false;
! 	}
      }
  
  #if defined (COFF_LONG_SECTION_NAMES) && defined (COFF_SUPPORT_GNU_LINKONCE)
*************** styp_to_sec_flags (abfd, hdr, name, sect
*** 1091,1097 ****
      sec_flags |= SEC_LINK_ONCE | SEC_LINK_DUPLICATES_DISCARD;
  #endif
  
!   return sec_flags;
  }
  
  #endif /* COFF_WITH_PE */
--- 1087,1096 ----
      sec_flags |= SEC_LINK_ONCE | SEC_LINK_DUPLICATES_DISCARD;
  #endif
  
!   if (flags_ptr)
!     * flags_ptr = sec_flags;
!   
!   return result;
  }
  
  #endif /* COFF_WITH_PE */
*************** dependent COFF routines:
*** 1227,1237 ****
  .       bfd     *abfd,
  .       PTR     internal_filehdr,
  .       PTR     internal_aouthdr));
! . flagword (*_bfd_styp_to_sec_flags_hook) PARAMS ((
  .       bfd     *abfd,
  .       PTR     internal_scnhdr,
  .       const char *name,
! .       asection *section));
  . void (*_bfd_set_alignment_hook) PARAMS ((
  .       bfd     *abfd,
  .       asection *sec,
--- 1226,1237 ----
  .       bfd     *abfd,
  .       PTR     internal_filehdr,
  .       PTR     internal_aouthdr));
! . boolean (*_bfd_styp_to_sec_flags_hook) PARAMS ((
  .       bfd     *abfd,
  .       PTR     internal_scnhdr,
  .       const char *name,
! .       asection *section
! .       flagword *flags_ptr));
  . void (*_bfd_set_alignment_hook) PARAMS ((
  .       bfd     *abfd,
  .       asection *sec,
*************** dependent COFF routines:
*** 1385,1393 ****
  .#define bfd_coff_mkobject_hook(abfd, filehdr, aouthdr)\
  .        ((coff_backend_info (abfd)->_bfd_coff_mkobject_hook) (abfd, filehdr, aouthdr))
  .
! .#define bfd_coff_styp_to_sec_flags_hook(abfd, scnhdr, name, section)\
  .        ((coff_backend_info (abfd)->_bfd_styp_to_sec_flags_hook)\
! .         (abfd, scnhdr, name, section))
  .
  .#define bfd_coff_set_alignment_hook(abfd, sec, scnhdr)\
  .        ((coff_backend_info (abfd)->_bfd_set_alignment_hook) (abfd, sec, scnhdr))
--- 1385,1393 ----
  .#define bfd_coff_mkobject_hook(abfd, filehdr, aouthdr)\
  .        ((coff_backend_info (abfd)->_bfd_coff_mkobject_hook) (abfd, filehdr, aouthdr))
  .
! .#define bfd_coff_styp_to_sec_flags_hook(abfd, scnhdr, name, section, flags_ptr)\
  .        ((coff_backend_info (abfd)->_bfd_styp_to_sec_flags_hook)\
! .         (abfd, scnhdr, name, section, flags_ptr))
  .
  .#define bfd_coff_set_alignment_hook(abfd, sec, scnhdr)\
  .        ((coff_backend_info (abfd)->_bfd_set_alignment_hook) (abfd, sec, scnhdr))
Index: bfd/coffgen.c
===================================================================
RCS file: /cvs/src/src/bfd/coffgen.c,v
retrieving revision 1.21
diff -p -r1.21 coffgen.c
*** coffgen.c	2001/05/24 20:50:50	1.21
--- coffgen.c	2001/06/12 17:26:00
*************** make_a_section_from_file (abfd, hdr, tar
*** 82,87 ****
--- 82,89 ----
  {
    asection *return_section;
    char *name;
+   boolean result = true;
+   flagword flags;
  
    name = NULL;
  
*************** make_a_section_from_file (abfd, hdr, tar
*** 142,150 ****
    return_section->userdata = NULL;
    return_section->next = (asection *) NULL;
    return_section->target_index = target_index;
-   return_section->flags = bfd_coff_styp_to_sec_flags_hook (abfd, hdr, name,
- 							   return_section);
  
    /* At least on i386-coff, the line number count for a shared library
       section must be ignored.  */
    if ((return_section->flags & SEC_COFF_SHARED_LIBRARY) != 0)
--- 144,156 ----
    return_section->userdata = NULL;
    return_section->next = (asection *) NULL;
    return_section->target_index = target_index;
  
+   if (! bfd_coff_styp_to_sec_flags_hook (abfd, hdr, name, return_section,
+ 					 & flags))
+     result = false;
+   
+   return_section->flags = flags;
+ 
    /* At least on i386-coff, the line number count for a shared library
       section must be ignored.  */
    if ((return_section->flags & SEC_COFF_SHARED_LIBRARY) != 0)
*************** make_a_section_from_file (abfd, hdr, tar
*** 155,161 ****
    /* FIXME: should this check 'hdr->s_size > 0' */
    if (hdr->s_scnptr != 0)
      return_section->flags |= SEC_HAS_CONTENTS;
!   return true;
  }
  
  /* Read in a COFF object and make it into a BFD.  This is used by
--- 161,168 ----
    /* FIXME: should this check 'hdr->s_size > 0' */
    if (hdr->s_scnptr != 0)
      return_section->flags |= SEC_HAS_CONTENTS;
! 
!   return result;
  }
  
  /* Read in a COFF object and make it into a BFD.  This is used by
Index: bfd/ecoff.c
===================================================================
RCS file: /cvs/src/src/bfd/ecoff.c,v
retrieving revision 1.9
diff -p -r1.9 ecoff.c
*** ecoff.c	2001/05/17 03:58:45	1.9
--- ecoff.c	2001/06/12 17:26:05
*************** ecoff_sec_to_styp_flags (name, flags)
*** 371,386 ****
  
  /* Get the BFD flags to use for a section.  */
  
! flagword
! _bfd_ecoff_styp_to_sec_flags (abfd, hdr, name, section)
       bfd *abfd ATTRIBUTE_UNUSED;
       PTR hdr;
       const char *name ATTRIBUTE_UNUSED;
       asection *section ATTRIBUTE_UNUSED;
  {
    struct internal_scnhdr *internal_s = (struct internal_scnhdr *) hdr;
    long styp_flags = internal_s->s_flags;
!   flagword sec_flags=0;
  
    if (styp_flags & STYP_NOLOAD)
      sec_flags |= SEC_NEVER_LOAD;
--- 371,387 ----
  
  /* Get the BFD flags to use for a section.  */
  
! boolean
! _bfd_ecoff_styp_to_sec_flags (abfd, hdr, name, section, flags_ptr)
       bfd *abfd ATTRIBUTE_UNUSED;
       PTR hdr;
       const char *name ATTRIBUTE_UNUSED;
       asection *section ATTRIBUTE_UNUSED;
+      flagword * flags_ptr;
  {
    struct internal_scnhdr *internal_s = (struct internal_scnhdr *) hdr;
    long styp_flags = internal_s->s_flags;
!   flagword sec_flags = 0;
  
    if (styp_flags & STYP_NOLOAD)
      sec_flags |= SEC_NEVER_LOAD;
*************** _bfd_ecoff_styp_to_sec_flags (abfd, hdr,
*** 422,450 ****
      }
    else if ((styp_flags & STYP_BSS)
  	   || (styp_flags & STYP_SBSS))
!     {
!       sec_flags |= SEC_ALLOC;
!     }
    else if ((styp_flags & STYP_INFO) || styp_flags == STYP_COMMENT)
!     {
!       sec_flags |= SEC_NEVER_LOAD;
!     }
    else if ((styp_flags & STYP_LITA)
  	   || (styp_flags & STYP_LIT8)
  	   || (styp_flags & STYP_LIT4))
!     {
!       sec_flags |= SEC_DATA | SEC_LOAD | SEC_ALLOC | SEC_READONLY;
!     }
    else if (styp_flags & STYP_ECOFF_LIB)
!     {
!       sec_flags |= SEC_COFF_SHARED_LIBRARY;
!     }
    else
!     {
!       sec_flags |= SEC_ALLOC | SEC_LOAD;
!     }
  
!   return sec_flags;
  }
  
  /* Read in the symbolic header for an ECOFF object file.  */
--- 423,442 ----
      }
    else if ((styp_flags & STYP_BSS)
  	   || (styp_flags & STYP_SBSS))
!     sec_flags |= SEC_ALLOC;
    else if ((styp_flags & STYP_INFO) || styp_flags == STYP_COMMENT)
!     sec_flags |= SEC_NEVER_LOAD;
    else if ((styp_flags & STYP_LITA)
  	   || (styp_flags & STYP_LIT8)
  	   || (styp_flags & STYP_LIT4))
!     sec_flags |= SEC_DATA | SEC_LOAD | SEC_ALLOC | SEC_READONLY;
    else if (styp_flags & STYP_ECOFF_LIB)
!     sec_flags |= SEC_COFF_SHARED_LIBRARY;
    else
!     sec_flags |= SEC_ALLOC | SEC_LOAD;
  
!   * flags_ptr = sec_flags;
!   return true;
  }
  
  /* Read in the symbolic header for an ECOFF object file.  */


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