MIPS gas doesn't set SH_FLAG

Nick Clifton nickc@redhat.com
Mon Feb 28 19:38:00 GMT 2005


Hi Brett, Hi Eric, Hi Thiemo,

 > Brett Porter wrote:
> Here is a rather simple program:
> 
>         .section .debug_frame,0x7000001e,0x8000000,0,4
>         .byte   0
> 
> I'm trying to assemble it on an IRIX64 6.5 system with a recently
> released gas and with gas built from snapshot sources dated today.
> 
> That section flag bit is for SHF_MIPS_NOSTRIP.  elfdump shows that
> it isn't set in the output file.  It is set when assembled with the
> IRIX assembler. I bumped into this one -- didn't go hunting for
> other flags...
> 
> Is this a simple missing piece or part of a bigger, messier puzzle,
> or ???

It is a bigger, messier puzzle in that no MIPS specific ELF section 
header flags can (currently) be set via the .section directive.

The MIPS port of GAS does have special code to handle setting other 
section header flags via the .section directive, so I am assuming that 
the intent was that MIPS specific flags would be supported too.

Hence I am offering up the attached patch as a possible solution.  Eric, 
Thiemo - what do you think ?  Tested with no regressions on mips-elf, 
mips64-linux-gnu and mipsisa32el-linux-gnu targets.

Note - as an aside I noticed that readelf does not currently decode and 
display the values of MIPS specific section flags - it probably should 
do this, if somebody wanted to write the code...

Cheers
   Nick

bfd/ChangeLog
2005-02-28  Nick Clifton  <nickc@redhat.com>

	* elfxx-mips.c (_bfd_mips_elf_fake_sections): Copy user specified,
	MIPS specific section flags into the fake section's header.

gas/ChangeLog
2005-02-28  Nick Clifton  <nickc@redhat.com>

	* config/tc-mips.c (mips_elf_section_flags): New function.  Ensure
	that user specified MIPS specific section flags are permitted in
	the section header.
	* config/tc-mips.h (md_elf_section_flags): Define.  Use
	mips_elf_section_flags.



More information about the Binutils mailing list