This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: MIPS gas doesn't set SH_FLAG


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);

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]