+2003-10-24  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * config/obj-elf.c (obj_elf_change_section): Allow SHF_ALLOC
+       for .interp, .strtab and .symtab. Use specified section
+       attributes.
+
 2003-10-22  Andreas Schwab  <schwab@suse.de>
            H.J. Lu  <hongjiu.lu@intel.com>
            Jim Wilson <wilson@specifixinc.com>
 
 
   if (ssect != NULL)
     {
+      bfd_boolean override = FALSE;
+
       if (type == SHT_NULL)
        type = ssect->type;
       else if (type != ssect->type)
            }
        }
 
-      if (old_sec == NULL && (attr &~ ssect->attr) != 0)
+      if (old_sec == NULL && (attr & ~ssect->attr) != 0)
        {
          /* As a GNU extension, we permit a .note section to be
             allocatable.  If the linker sees an allocatable .note
             something like .rodata.str.  */
          else if (ssect->suffix_length == -2
                   && name[ssect->prefix_length] == '.'
-                  && (attr &~ ssect->attr &~ SHF_MERGE &~ SHF_STRINGS) == 0)
+                  && (attr
+                      & ~ssect->attr
+                      & ~SHF_MERGE
+                      & ~SHF_STRINGS) == 0)
            ;
+         /* .interp, .strtab and .symtab can have SHF_ALLOC.  */
+         else if (attr == SHF_ALLOC
+                  && (strcmp (name, ".interp") == 0
+                      || strcmp (name, ".strtab") == 0
+                      || strcmp (name, ".symtab") == 0))
+           override = TRUE;
          else
-           as_warn (_("setting incorrect section attributes for %s"),
-                    name);
+           {
+             as_warn (_("setting incorrect section attributes for %s"),
+                      name);
+             override = TRUE;
+           }
        }
-      if (old_sec == NULL)
+      if (!override && old_sec == NULL)
        attr |= ssect->attr;
     }