PATCH: Don't use section name to set ELF section data

H. J. Lu hjl@lucon.org
Fri Jul 25 16:10:00 GMT 2003


On Fri, Jul 25, 2003 at 07:38:06AM -0700, H. J. Lu wrote:
> On Fri, Jul 25, 2003 at 01:25:31PM +0100, Nick Clifton wrote:
> > Hi H.J.
> > 
> > > Here is the new patch. It caused no regressions on all targets
> > > affected. It fixed an ELF/ppc64 bug.
> > 
> > Excellent.
> 
> ...
> 
> > Approved - please apply.
> > 
> 
> Done. I made a small change. I used
> 
>   if (! BFD_SEND ((B), _new_section_hook, ((B), (S)))) \
> 
> instead of
> 
>   if (!_bfd_elf_new_section_hook ((B), (S)))                  \
>  

My patch mishandled the case:

	.section .foo,"aw",@nobits

I checked in the following patch as an obvious fix.


H.J.
-------------- next part --------------
2003-07-25  H.J. Lu  <hongjiu.lu@intel.com>

	* config/obj-elf.c (obj_elf_change_section): Always set section
	type and flags.

--- gas/config/obj-elf.c.type	2003-07-25 09:03:06.000000000 -0700
+++ gas/config/obj-elf.c	2003-07-25 08:59:49.000000000 -0700
@@ -681,11 +681,11 @@ obj_elf_change_section (name, type, attr
 		     name);
 	}
       attr |= def_attr;
-
-      elf_section_type (sec) = type;
-      elf_section_flags (sec) = attr;
     }
 
+  elf_section_type (sec) = type;
+  elf_section_flags (sec) = attr;
+
   /* Convert ELF type and flags to BFD flags.  */
   flags = (SEC_RELOC
 	   | ((attr & SHF_WRITE) ? 0 : SEC_READONLY)


More information about the Binutils mailing list