]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
lang_size_relro_segment tidy
authorAlan Modra <amodra@gmail.com>
Fri, 14 Jan 2022 01:54:22 +0000 (12:24 +1030)
committerAlan Modra <amodra@gmail.com>
Tue, 18 Jan 2022 00:48:51 +0000 (11:18 +1030)
This function has seen too many minimal change style edits.
No functional changes in this patch.

* ldlang.c (lang_size_relro_segment): Tidy.

ld/ldlang.c

index 499a9c7182c6399d2a2dd37303e306d1f9e21600..93fcfc4cbc7b8f6f6858e0a8a8005b0ce56ab367 100644 (file)
@@ -6465,36 +6465,24 @@ static bool
 lang_size_relro_segment (bool *relax, bool check_regions)
 {
   bool do_reset = false;
-  bool do_data_relro;
-  bfd_vma data_initial_base, data_relro_end;
 
   if (link_info.relro && expld.dataseg.relro_end)
     {
-      do_data_relro = true;
-      data_initial_base = expld.dataseg.base;
-      data_relro_end = lang_size_relro_segment_1 (&expld.dataseg);
-    }
-  else
-    {
-      do_data_relro = false;
-      data_initial_base = data_relro_end = 0;
-    }
+      bfd_vma data_initial_base = expld.dataseg.base;
+      bfd_vma data_relro_end = lang_size_relro_segment_1 (&expld.dataseg);
 
-  if (do_data_relro)
-    {
       lang_reset_memory_regions ();
       one_lang_size_sections_pass (relax, check_regions);
 
       /* Assignments to dot, or to output section address in a user
         script have increased padding over the original.  Revert.  */
-      if (do_data_relro && expld.dataseg.relro_end > data_relro_end)
+      if (expld.dataseg.relro_end > data_relro_end)
        {
          expld.dataseg.base = data_initial_base;;
          do_reset = true;
        }
     }
-
-  if (!do_data_relro && lang_size_segment (&expld.dataseg))
+  else if (lang_size_segment (&expld.dataseg))
     do_reset = true;
 
   return do_reset;