This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: MIPS gas doesn't set SH_FLAG
- From: Nick Clifton <nickc at redhat dot com>
- To: Eric Christopher <echristo at redhat dot com>
- Cc: Brett Porter <porter at adacore dot com>, seufer at csv dot ica dot uni-stuttgart dot de, binutils at sources dot redhat dot com
- Date: Tue, 01 Mar 2005 09:59:01 +0000
- Subject: Re: MIPS gas doesn't set SH_FLAG
- References: <5.1.0.14.0.20050223142247.01c54d50@sherlock> <Pine.GSO.4.58.0502232002530.3552@nile.gnat.com> <4223544F.7000407@redhat.com> <1109639860.16067.9.camel@localhost.localdomain>
Hi Eric, Hi Brett, Hi Thiemo,
ChangeLogs look good, how about that patch? :)
I could have sworn that I attached the file. Oh well... Here it is again.
Cheers
Nick
Index: bfd/elfxx-mips.c
===================================================================
RCS file: /cvs/src/src/bfd/elfxx-mips.c,v
retrieving revision 1.124
diff -c -3 -p -r1.124 elfxx-mips.c
*** bfd/elfxx-mips.c 23 Feb 2005 11:39:14 -0000 1.124
--- bfd/elfxx-mips.c 28 Feb 2005 17:01:12 -0000
*************** _bfd_mips_elf_fake_sections (bfd *abfd,
*** 4578,4583 ****
--- 4578,4587 ----
name = bfd_get_section_name (abfd, sec);
+ /* If the user has specified any MIPS specific
+ flags then make sure that they are propogated. */
+ hdr->sh_flags |= (sec->flags & (SHF_MASKOS | SHF_MASKPROC));
+
if (strcmp (name, ".liblist") == 0)
{
hdr->sh_type = SHT_MIPS_LIBLIST;
Index: gas/config/tc-mips.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-mips.c,v
retrieving revision 1.287
diff -c -3 -p -r1.287 tc-mips.c
*** gas/config/tc-mips.c 23 Feb 2005 12:28:04 -0000 1.287
--- gas/config/tc-mips.c 28 Feb 2005 17:01:16 -0000
*************** s_change_section (int ignore ATTRIBUTE_U
*** 11385,11398 ****
--- 11385,11401 ----
section_type = get_absolute_expression ();
else
section_type = 0;
+
if (*input_line_pointer++ == ',')
section_flag = get_absolute_expression ();
else
section_flag = 0;
+
if (*input_line_pointer++ == ',')
section_entry_size = get_absolute_expression ();
else
section_entry_size = 0;
+
if (*input_line_pointer++ == ',')
section_alignment = get_absolute_expression ();
else
*************** s_change_section (int ignore ATTRIBUTE_U
*** 11424,11429 ****
--- 11427,11447 ----
#endif /* OBJ_ELF */
}
+ #ifdef OBJ_ELF
+ /* Ensure that any MIPS specific flags in ATTR are passed
+ on to FLAGS. */
+
+ int
+ mips_elf_section_flags (flagword flags, int attr)
+ {
+ /* Strictly speaking we ought to only select those bits in the OS and PROC
+ specific sections of the flags which we know to have defined meanings
+ for the MIPS. But using the masks is easier and will prevent stange
+ bugs when new flags are added but this code is not updated. */
+ return flags | (attr & (SHF_MASKPROC | SHF_MASKOS));
+ }
+ #endif /* OBJ_ELF */
+
void
mips_enable_auto_align (void)
{
Index: gas/config/tc-mips.h
===================================================================
RCS file: /cvs/src/src/gas/config/tc-mips.h,v
retrieving revision 1.35
diff -c -3 -p -r1.35 tc-mips.h
*** gas/config/tc-mips.h 29 Apr 2004 05:14:22 -0000 1.35
--- gas/config/tc-mips.h 28 Feb 2005 17:01:16 -0000
*************** extern unsigned long mips_cprmask[4];
*** 150,155 ****
--- 150,158 ----
#define elf_tc_final_processing mips_elf_final_processing
extern void mips_elf_final_processing (void);
+ #define md_elf_section_flags(FLAGS, ATTR, TYPE) \
+ mips_elf_section_flags ((FLAGS), (ATTR))
+ extern int mips_elf_section_flags (flagword, int);
#endif
extern void md_mips_end (void);