--set-section-flags

mike stump mrs@windriver.com
Thu Nov 15 04:59:00 GMT 2001


When --set-section-flags is used, and a section has relocation
information, the relocs are stripped, this seems counter to what the
user probably wanted to do.  This change preserves the relocation
information, if there was some.

What do you think?

2001-11-28  mike stump  <mrs@kankakee.wrs.com>

	* objcopy.c (setup_section): Preserve SEC_RELOC when
          --set-section-flags is used.

Doing diffs in objcopy.c.~1~:
*** objcopy.c.~1~	Wed Nov 28 14:52:37 2001
--- objcopy.c	Wed Nov 28 14:53:14 2001
*************** setup_section (ibfd, isection, obfdarg)
*** 1677,1683 ****
  
    flags = bfd_get_section_flags (ibfd, isection);
    if (p != NULL && p->set_flags)
!     flags = p->flags | (flags & SEC_HAS_CONTENTS);
    if (!bfd_set_section_flags (obfd, osection, flags))
      {
        err = _("flags");
--- 1677,1683 ----
  
    flags = bfd_get_section_flags (ibfd, isection);
    if (p != NULL && p->set_flags)
!     flags = p->flags | (flags & (SEC_HAS_CONTENTS | SEC_RELOC));
    if (!bfd_set_section_flags (obfd, osection, flags))
      {
        err = _("flags");
--------------



More information about the Binutils mailing list