]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
ELF: drop "push" parameter from obj_elf_change_section()
authorJan Beulich <jbeulich@suse.com>
Fri, 15 Dec 2023 11:41:21 +0000 (12:41 +0100)
committerJan Beulich <jbeulich@suse.com>
Fri, 15 Dec 2023 11:41:21 +0000 (12:41 +0100)
No caller outside of obj-elf.c cares about the parameter - drop it by
introducing an obj-elf.c-internal wrapper.

While adding the new function parameter, take the opportunity and change
the adjacent boolean one to "bool".

gas/config/obj-elf.c
gas/config/obj-elf.h
gas/config/tc-arm.c
gas/config/tc-ia64.c
gas/config/tc-microblaze.c
gas/config/tc-mips.c
gas/config/tc-msp430.c
gas/config/tc-rx.c
gas/config/tc-tic6x.c

index eaf2d6a2f2985fb841e33eaa5b26259e4be88ba6..23eff51dbcfbd1bca7b06b62ae19dc4cd736c1a4 100644 (file)
@@ -540,14 +540,14 @@ get_section_by_match (bfd *abfd ATTRIBUTE_UNUSED, asection *sec, void *inf)
    other possibilities, but I don't know what they are.  In any case,
    BFD doesn't really let us set the section type.  */
 
-void
-obj_elf_change_section (const char *name,
-                       unsigned int type,
-                       bfd_vma attr,
-                       int entsize,
-                       struct elf_section_match *match_p,
-                       int linkonce,
-                       int push)
+static void
+change_section (const char *name,
+               unsigned int type,
+               bfd_vma attr,
+               int entsize,
+               struct elf_section_match *match_p,
+               bool linkonce,
+               bool push)
 {
   asection *old_sec;
   segT sec;
@@ -820,6 +820,17 @@ obj_elf_change_section (const char *name,
 #endif
 }
 
+void
+obj_elf_change_section (const char *name,
+                       unsigned int type,
+                       bfd_vma attr,
+                       int entsize,
+                       struct elf_section_match *match_p,
+                       bool linkonce)
+{
+  change_section (name, type, attr, entsize, match_p, linkonce, false);
+}
+
 static bfd_vma
 obj_elf_parse_section_letters (char *str, size_t len,
                               bool *is_clone, int *inherit, bfd_vma *gnu_attr)
@@ -1488,8 +1499,7 @@ obj_elf_section (int push)
        }
     }
 
-  obj_elf_change_section (name, type, attr, entsize, &match, linkonce,
-                         push);
+  change_section (name, type, attr, entsize, &match, linkonce, push);
 
   if (linked_to_section_index != -1UL)
     {
index 683d0851585a7d26c35c87e7fad263c265126e77..fdd7363caf4345b918121df2abfbfbbbf2ae615e 100644 (file)
@@ -198,7 +198,7 @@ extern void obj_elf_data (int);
 extern void obj_elf_text (int);
 extern void obj_elf_change_section
   (const char *, unsigned int, bfd_vma, int, struct elf_section_match *,
-   int, int);
+   bool);
 extern void obj_elf_vtable_inherit (int);
 extern void obj_elf_vtable_entry (int);
 extern struct fix * obj_elf_get_vtable_inherit (void);
index 56345eacebf6b1473dcf99c2b669adcee2c5339c..1eeb05ff590f075ee1742600b5f11e694579e8b5 100644 (file)
@@ -27775,7 +27775,7 @@ start_unwind_section (const segT text_seg, int idx)
     }
 
   obj_elf_change_section (sec_name, type, flags, 0, &match,
-                         linkonce, 0);
+                         linkonce);
 
   /* Set the section link for index tables.  */
   if (idx)
index 0b97986f10baef753bde61223f8f016d9ca51007..509dc3b77946fe32e4038b981fb4da2be994ac78 100644 (file)
@@ -1139,7 +1139,7 @@ obj_elf_vms_common (int ignore ATTRIBUTE_UNUSED)
   obj_elf_change_section
     (sec_name, SHT_NOBITS,
      SHF_ALLOC | SHF_WRITE | SHF_IA_64_VMS_OVERLAID | SHF_IA_64_VMS_GLOBAL,
-     0, NULL, 1, 0);
+     0, NULL, true);
 
   S_SET_VALUE (symbolP, 0);
   S_SET_SIZE (symbolP, size);
index 604cc935da9629653c1202aa6b42c457129229b8..517903c784255d5021f050bf9407861758f29f67 100644 (file)
@@ -150,7 +150,7 @@ microblaze_s_data (int ignore ATTRIBUTE_UNUSED)
 {
 #ifdef OBJ_ELF
   obj_elf_change_section (".data", SHT_PROGBITS, SHF_ALLOC+SHF_WRITE,
-                         0, 0, 0, 0);
+                         0, 0, false);
 #else
   s_data (ignore);
 #endif
@@ -163,7 +163,7 @@ microblaze_s_sdata (int ignore ATTRIBUTE_UNUSED)
 {
 #ifdef OBJ_ELF
   obj_elf_change_section (".sdata", SHT_PROGBITS, SHF_ALLOC+SHF_WRITE,
-                         0, 0, 0, 0);
+                         0, 0, false);
 #else
   s_data (ignore);
 #endif
@@ -282,7 +282,7 @@ microblaze_s_rdata (int localvar)
     {
       /* rodata.  */
       obj_elf_change_section (".rodata", SHT_PROGBITS, SHF_ALLOC,
-                             0, 0, 0, 0);
+                             0, 0, false);
       if (rodata_segment == 0)
        rodata_segment = subseg_new (".rodata", 0);
     }
@@ -290,7 +290,7 @@ microblaze_s_rdata (int localvar)
     {
       /* 1 .sdata2.  */
       obj_elf_change_section (".sdata2", SHT_PROGBITS, SHF_ALLOC,
-                             0, 0, 0, 0);
+                             0, 0, false);
     }
 #else
   s_data (ignore);
@@ -303,12 +303,12 @@ microblaze_s_bss (int localvar)
 #ifdef OBJ_ELF
   if (localvar == 0) /* bss.  */
     obj_elf_change_section (".bss", SHT_NOBITS, SHF_ALLOC+SHF_WRITE,
-                           0, 0, 0, 0);
+                           0, 0, false);
   else if (localvar == 1)
     {
       /* sbss.  */
       obj_elf_change_section (".sbss", SHT_NOBITS, SHF_ALLOC+SHF_WRITE,
-                             0, 0, 0, 0);
+                             0, 0, false);
       if (sbss_segment == 0)
        sbss_segment = subseg_new (".sbss", 0);
     }
index 4d40d56902a31dc700a0c056afb1846aa9c87743..14b969b955077d47e3bc9c6cd5940b7473c58ccf 100644 (file)
@@ -16435,7 +16435,7 @@ s_change_section (int ignore ATTRIBUTE_UNUSED)
     section_type = SHT_PROGBITS;
 
   obj_elf_change_section (section_name, section_type, section_flag,
-                         section_entry_size, 0, 0, 0);
+                         section_entry_size, 0, false);
 }
 
 void
index e3c66a3ba7c39ef73a5a391a931f15d8308bb6c4..8d34fc36c71e9bdf2daddc5967c1b9268a84958d 100644 (file)
@@ -622,7 +622,7 @@ msp430_profiler (int dummy ATTRIBUTE_UNUSED)
   subseg = now_subseg;
 
   /* Now go to .profiler section.  */
-  obj_elf_change_section (".profiler", SHT_PROGBITS, 0, 0, 0, 0, 0);
+  obj_elf_change_section (".profiler", SHT_PROGBITS, 0, 0, 0, false);
 
   /* Save flags.  */
   emit_expr (& exp, 2);
index c011ec11b4b094d24c08a693abc33941cc6b78ea..2a5dca73d76c33654d3e63bdb24c7d6bf6737d66 100644 (file)
@@ -488,7 +488,7 @@ parse_rx_section (char * name)
       else
        type = SHT_NOBITS;
 
-      obj_elf_change_section (name, type, attr, 0, NULL, false, false);
+      obj_elf_change_section (name, type, attr, 0, NULL, false);
     }
   else /* Try not to redefine a section, especially B_1.  */
     {
@@ -503,7 +503,7 @@ parse_rx_section (char * name)
        | ((flags & SEC_STRINGS) ? SHF_STRINGS : 0)
        | ((flags & SEC_THREAD_LOCAL) ? SHF_TLS : 0);
 
-      obj_elf_change_section (name, type, attr, 0, NULL, false, false);
+      obj_elf_change_section (name, type, attr, 0, NULL, false);
     }
 
   bfd_set_section_alignment (now_seg, align);
index 6ed61ea49bc108783795135ca4ed3655638cb7f7..67a662e90939538825b4ed80bff4da9323990cd9 100644 (file)
@@ -4662,7 +4662,7 @@ tic6x_start_unwind_section (const segT text_seg, int idx)
     }
 
   obj_elf_change_section (sec_name, type, flags, 0, &match,
-                         linkonce, 0);
+                         linkonce);
 
   /* Set the section link for index tables.  */
   if (idx)