]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Constify elf_backend_eh_frame_address_size
authorAlan Modra <amodra@gmail.com>
Thu, 27 Apr 2017 02:33:39 +0000 (12:03 +0930)
committerAlan Modra <amodra@gmail.com>
Thu, 27 Apr 2017 02:33:39 +0000 (12:03 +0930)
* elf-bfd.h (struct elf_backend_data): Make asection param of
elf_backend_eh_frame_address_size const.
(_bfd_elf_eh_frame_address_size): Likewise.
* elf32-m32c.c (_bfd_m32c_elf_eh_frame_address_size): Likewise.
* elf32-msp430.c (elf32_msp430_eh_frame_address_size): Likewise.
* elfxx-mips.c (_bfd_mips_elf_eh_frame_address_size): Likewise.
* elfxx-mips.h (_bfd_mips_elf_eh_frame_address_size): Likewise.
* elf-eh-frame.c (_bfd_elf_eh_frame_address_size): Likewise.
(next_cie_fde_offset): Constify params.
(offset_adjust, adjust_eh_frame_local_symbols): Likewise.

bfd/ChangeLog
bfd/elf-bfd.h
bfd/elf-eh-frame.c
bfd/elf32-m32c.c
bfd/elf32-msp430.c
bfd/elfxx-mips.c
bfd/elfxx-mips.h

index 0f08ddd1e3e9108130e7d1242217d5881163d640..376f2013cf4953aadfdf7e27a1e24edafd23310f 100644 (file)
@@ -1,3 +1,16 @@
+2017-04-27  Alan Modra  <amodra@gmail.com>
+
+       * elf-bfd.h (struct elf_backend_data): Make asection param of
+       elf_backend_eh_frame_address_size const.
+       (_bfd_elf_eh_frame_address_size): Likewise.
+       * elf32-m32c.c (_bfd_m32c_elf_eh_frame_address_size): Likewise.
+       * elf32-msp430.c (elf32_msp430_eh_frame_address_size): Likewise.
+       * elfxx-mips.c (_bfd_mips_elf_eh_frame_address_size): Likewise.
+       * elfxx-mips.h (_bfd_mips_elf_eh_frame_address_size): Likewise.
+       * elf-eh-frame.c (_bfd_elf_eh_frame_address_size): Likewise.
+       (next_cie_fde_offset): Constify params.
+       (offset_adjust, adjust_eh_frame_local_symbols): Likewise.
+
 2017-04-27  Alan Modra  <amodra@gmail.com>
 
        * elf-bfd.h (struct eh_cie_fde): Add aug_str_len and aug_data_len.
index bff6abc6691776a4d6e737b13ca1ad17efa589ad..79f87b233e76789bb889d77ba806100b892671b9 100644 (file)
@@ -1291,7 +1291,7 @@ struct elf_backend_data
      that can't be determined for some reason.  The default definition
      goes by the bfd's EI_CLASS.  */
   unsigned int (*elf_backend_eh_frame_address_size)
-    (bfd *, asection *);
+    (bfd *, const asection *);
 
   /* These functions tell elf-eh-frame whether to attempt to turn
      absolute or lsda encodings into pc-relative ones.  The default
@@ -1987,7 +1987,7 @@ extern void bfd_elf_print_symbol
   (bfd *, void *, asymbol *, bfd_print_symbol_type);
 
 extern unsigned int _bfd_elf_eh_frame_address_size
-  (bfd *, asection *);
+  (bfd *, const asection *);
 extern bfd_byte _bfd_elf_encode_eh_address
   (bfd *abfd, struct bfd_link_info *info, asection *osec, bfd_vma offset,
    asection *loc_sec, bfd_vma loc_offset, bfd_vma *encoded);
index 1af6f30908313603b372c43d6be0626481040225..52ba9c62138bb7d2c8901d961ba322dbfe23e220 100644 (file)
@@ -326,9 +326,9 @@ size_of_output_cie_fde (struct eh_cie_fde *entry)
 /* Return the offset of the FDE or CIE after ENT.  */
 
 static unsigned int
-next_cie_fde_offset (struct eh_cie_fde *ent,
-                    struct eh_cie_fde *last,
-                    asection *sec)
+next_cie_fde_offset (const struct eh_cie_fde *ent,
+                    const struct eh_cie_fde *last,
+                    const asection *sec)
 {
   while (++ent < last)
     {
@@ -1334,7 +1334,7 @@ find_merged_cie (bfd *abfd, struct bfd_link_info *info, asection *sec,
    after .eh_frame editing.  */
 
 static bfd_signed_vma
-offset_adjust (bfd_vma offset, asection *sec)
+offset_adjust (bfd_vma offset, const asection *sec)
 {
   struct eh_frame_sec_info *sec_info
     = (struct eh_frame_sec_info *) elf_section_data (sec)->sec_info;
@@ -1442,7 +1442,7 @@ _bfd_elf_adjust_eh_frame_global_symbol (struct elf_link_hash_entry *h,
    if any symbol was changed.  */
 
 static int
-adjust_eh_frame_local_symbols (asection *sec,
+adjust_eh_frame_local_symbols (const asection *sec,
                               struct elf_reloc_cookie *cookie)
 {
   unsigned int shndx;
@@ -2546,7 +2546,7 @@ _bfd_elf_write_section_eh_frame_hdr (bfd *abfd, struct bfd_link_info *info)
 /* Return the width of FDE addresses.  This is the default implementation.  */
 
 unsigned int
-_bfd_elf_eh_frame_address_size (bfd *abfd, asection *sec ATTRIBUTE_UNUSED)
+_bfd_elf_eh_frame_address_size (bfd *abfd, const asection *sec ATTRIBUTE_UNUSED)
 {
   return elf_elfheader (abfd)->e_ident[EI_CLASS] == ELFCLASS64 ? 8 : 4;
 }
index 1944465aac47062b6a0c613ad3c8db3c6ec97b0c..0ee67b7aebd8d228a6400173576cb42a319a167a 100644 (file)
@@ -2107,7 +2107,8 @@ m32c_elf_relax_delete_bytes
 \f
 /* This is for versions of gcc prior to 4.3.  */
 static unsigned int
-_bfd_m32c_elf_eh_frame_address_size (bfd *abfd, asection *sec ATTRIBUTE_UNUSED)
+_bfd_m32c_elf_eh_frame_address_size (bfd *abfd,
+                                    const asection *sec ATTRIBUTE_UNUSED)
 {
   if ((elf_elfheader (abfd)->e_flags & EF_M32C_CPU_MASK) == EF_M32C_CPU_M16C)
     return 2;
index 8755280393bf988bb21523f09148cc777000560a..25bbdc8e324cf2d3cdd07cfddff0cd444e528241 100644 (file)
@@ -2552,7 +2552,8 @@ uses_large_model (bfd *abfd)
 }
 
 static unsigned int
-elf32_msp430_eh_frame_address_size (bfd *abfd, asection *sec ATTRIBUTE_UNUSED)
+elf32_msp430_eh_frame_address_size (bfd *abfd,
+                                   const asection *sec ATTRIBUTE_UNUSED)
 {
   return uses_large_model (abfd) ? 4 : 2;
 }
index 8f6faad579e0e4f9eaecaa71875e496c2480ca37..70c7f1cc3dde66d6ef6c5b4827f7609c5da87092 100644 (file)
@@ -7028,7 +7028,7 @@ _bfd_mips_elf_symbol_processing (bfd *abfd, asymbol *asym)
    did so.  */
 
 unsigned int
-_bfd_mips_elf_eh_frame_address_size (bfd *abfd, asection *sec)
+_bfd_mips_elf_eh_frame_address_size (bfd *abfd, const asection *sec)
 {
   if (elf_elfheader (abfd)->e_ident[EI_CLASS] == ELFCLASS64)
     return 8;
index 45eb74fc2d4f9d36e91ff5d0d54cdd9c307609a8..44ad789371ebb3c6d3ea1fd29949d2025c07aac9 100644 (file)
@@ -29,7 +29,7 @@ extern bfd_boolean _bfd_mips_elf_new_section_hook
 extern void _bfd_mips_elf_symbol_processing
   (bfd *, asymbol *);
 extern unsigned int _bfd_mips_elf_eh_frame_address_size
-  (bfd *, asection *);
+  (bfd *, const asection *);
 extern bfd_boolean _bfd_mips_elf_name_local_section_symbols
   (bfd *);
 extern bfd_boolean _bfd_mips_elf_section_processing