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]

map "s" to small data on ia64 and alpha


I'd thought this was already present.


r~


        * elf64-alpha.c (elf64_alpha_section_flags): New.
        (elf64_alpha_fake_sections): Map SEC_SMALL_DATA to SHF_ALPHA_GPREL.

        * config/tc-alpha.c (alpha_elf_section_letter): New.
        (alpha_elf_section_flags): New.
        * config/tc-alpha.h (md_elf_section_letter): New.
        (md_elf_section_flags): New.
        * config/tc-ia64.c (ia64_elf_section_letter): New.
        * config/tc-ia64.h (md_elf_section_letter): New.

Index: bfd/elf64-alpha.c
===================================================================
RCS file: /cvs/src/src/bfd/elf64-alpha.c,v
retrieving revision 1.38
diff -c -p -d -r1.38 elf64-alpha.c
*** elf64-alpha.c	2001/09/11 18:21:11	1.38
--- elf64-alpha.c	2001/09/11 18:22:02
*************** static boolean elf64_alpha_object_p
*** 74,79 ****
--- 74,81 ----
    PARAMS((bfd *));
  static boolean elf64_alpha_section_from_shdr
    PARAMS((bfd *, Elf64_Internal_Shdr *, char *));
+ static boolean elf64_alpha_section_flags
+   PARAMS((flagword *, Elf64_Internal_Shdr *));
  static boolean elf64_alpha_fake_sections
    PARAMS((bfd *, Elf64_Internal_Shdr *, asection *));
  static boolean elf64_alpha_create_got_section
*************** elf64_alpha_section_from_shdr (abfd, hdr
*** 1641,1646 ****
--- 1643,1661 ----
    return true;
  }
  
+ /* Convert Alpha specific section flags to bfd internal section flags.  */
+ 
+ static boolean
+ elf64_alpha_section_flags (flags, hdr)
+      flagword *flags;
+      Elf64_Internal_Shdr *hdr;
+ {
+   if (hdr->sh_flags & SHF_ALPHA_GPREL)
+     *flags |= SEC_SMALL_DATA;
+ 
+   return true;
+ }
+ 
  /* Set the correct type for an Alpha ELF section.  We do this by the
     section name, which is a hack, but ought to work.  */
  
*************** elf64_alpha_fake_sections (abfd, hdr, se
*** 1664,1670 ****
        else
  	hdr->sh_entsize = 1;
      }
!   else if (strcmp (name, ".sdata") == 0
  	   || strcmp (name, ".sbss") == 0
  	   || strcmp (name, ".lit4") == 0
  	   || strcmp (name, ".lit8") == 0)
--- 1679,1686 ----
        else
  	hdr->sh_entsize = 1;
      }
!   else if ((sec->flags & SEC_SMALL_DATA)
! 	   || strcmp (name, ".sdata") == 0
  	   || strcmp (name, ".sbss") == 0
  	   || strcmp (name, ".lit4") == 0
  	   || strcmp (name, ".lit8") == 0)
*************** const struct elf_size_info alpha_elf_siz
*** 4220,4225 ****
--- 4236,4243 ----
  
  #define elf_backend_section_from_shdr \
    elf64_alpha_section_from_shdr
+ #define elf_backend_section_flags \
+   elf64_alpha_section_flags
  #define elf_backend_fake_sections \
    elf64_alpha_fake_sections
  
Index: gas/config/tc-alpha.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-alpha.c,v
retrieving revision 1.27
diff -c -p -d -r1.27 tc-alpha.c
*** tc-alpha.c	2001/09/08 01:12:00	1.27
--- tc-alpha.c	2001/09/11 18:22:06
*************** select_gp_value ()
*** 5399,5404 ****
--- 5399,5432 ----
  }
  #endif /* OBJ_ECOFF */
  
+ #ifdef OBJ_ELF
+ /* Map 's' to SHF_ALPHA_GPREL.  */
+ 
+ int
+ alpha_elf_section_letter (letter, ptr_msg)
+      int letter;
+      char **ptr_msg;
+ {
+   if (letter == 's')
+     return SHF_ALPHA_GPREL;
+ 
+   *ptr_msg = _("Bad .section directive: want a,s,w,x,M,S in string");
+   return 0;
+ }
+ 
+ /* Map SHF_ALPHA_GPREL to SEC_SMALL_DATA.  */
+ 
+ flagword
+ alpha_elf_section_flags (flags, attr, type)
+      flagword flags;
+      int attr, type ATTRIBUTE_UNUSED;
+ {
+   if (attr & SHF_ALPHA_GPREL)
+     flags |= SEC_SMALL_DATA;
+   return flags;
+ }
+ #endif /* OBJ_ELF */
+ 
  /* Called internally to handle all alignment needs.  This takes care
     of eliding calls to frag_align if'n the cached current alignment
     says we've already got it, as well as taking care of the auto-align
Index: gas/config/tc-alpha.h
===================================================================
RCS file: /cvs/src/src/gas/config/tc-alpha.h,v
retrieving revision 1.9
diff -c -p -d -r1.9 tc-alpha.h
*** tc-alpha.h	2001/09/05 02:39:43	1.9
--- tc-alpha.h	2001/09/11 18:22:06
*************** extern void alpha_frob_file_before_adjus
*** 108,113 ****
--- 108,118 ----
  #define ELF_TC_SPECIAL_SECTIONS \
    { ".sdata",   SHT_PROGBITS,   SHF_ALLOC + SHF_WRITE + SHF_ALPHA_GPREL  }, \
    { ".sbss",    SHT_NOBITS,     SHF_ALLOC + SHF_WRITE + SHF_ALPHA_GPREL  },
+ 
+ #define md_elf_section_letter		alpha_elf_section_letter
+ extern int alpha_elf_section_letter PARAMS ((int, char **));
+ #define md_elf_section_flags		alpha_elf_section_flags
+ extern flagword alpha_elf_section_flags PARAMS ((flagword, int, int));
  #endif
  
  /* Whether to add support for explict !relocation_op!sequence_number.  At the
Index: gas/config/tc-ia64.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-ia64.c,v
retrieving revision 1.57
diff -c -p -d -r1.57 tc-ia64.c
*** tc-ia64.c	2001/09/05 20:20:37	1.57
--- tc-ia64.c	2001/09/11 18:22:13
*************** set_section (name)
*** 916,921 ****
--- 916,935 ----
    input_line_pointer = saved_input_line_pointer;
  }
  
+ /* Map 's' to SHF_IA_64_SHORT.  */
+ 
+ int
+ ia64_elf_section_letter (letter, ptr_msg)
+      int letter;
+      char **ptr_msg;
+ {
+   if (letter == 's')
+     return SHF_IA_64_SHORT;
+ 
+   *ptr_msg = _("Bad .section directive: want a,s,w,x,M,S in string");
+   return 0;
+ }
+ 
  /* Map SHF_IA_64_SHORT to SEC_SMALL_DATA.  */
  
  flagword
Index: gas/config/tc-ia64.h
===================================================================
RCS file: /cvs/src/src/gas/config/tc-ia64.h,v
retrieving revision 1.13
diff -c -p -d -r1.13 tc-ia64.h
*** tc-ia64.h	2001/07/23 14:02:12	1.13
--- tc-ia64.h	2001/09/11 18:22:13
*************** extern void ia64_cons_fix_new PARAMS ((f
*** 81,86 ****
--- 81,87 ----
  				       expressionS *exp));
  extern void ia64_validate_fix PARAMS ((struct fix *fix));
  extern char * ia64_canonicalize_symbol_name PARAMS ((char *));
+ extern int ia64_elf_section_letter PARAMS ((int, char **));
  extern flagword ia64_elf_section_flags PARAMS ((flagword, int, int));
  extern int ia64_elf_section_type PARAMS ((const char *, size_t len));
  extern long ia64_pcrel_from_section PARAMS ((struct fix *fix, segT sec));
*************** extern void ia64_handle_align PARAMS ((f
*** 104,109 ****
--- 105,111 ----
  					as_fatal ("ia64_create_short_jump")
  #define md_estimate_size_before_relax(f,s) \
  			(as_fatal ("ia64_estimate_size_before_relax"), 1)
+ #define md_elf_section_letter		ia64_elf_section_letter
  #define md_elf_section_flags		ia64_elf_section_flags
  #define TC_FIX_TYPE			struct ia64_fix
  #define TC_INIT_FIX_DATA(f)		{ f->tc_fix_data.opnd = 0; }


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