]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
elflink.c: Replace bed->dynamic_sec_flags with flags
authorH.J. Lu <hjl.tools@gmail.com>
Mon, 3 Feb 2025 04:01:28 +0000 (12:01 +0800)
committerH.J. Lu <hjl.tools@gmail.com>
Tue, 4 Feb 2025 05:01:24 +0000 (13:01 +0800)
Since at the function entry, there is

  flags = bed->dynamic_sec_flags;

we can replace bed->dynamic_sec_flags with flags.

* elflink.c (_bfd_elf_create_got_section): Replace
bed->dynamic_sec_flags with flags.
(_bfd_elf_link_create_dynamic_sections): Likewise.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
bfd/elflink.c

index 309b4d75094baf91b993f92c406100b6c8a36852..a31e4092a16603c493cd5c57eaf0e284248a6354 100644 (file)
@@ -198,8 +198,7 @@ _bfd_elf_create_got_section (bfd *abfd, struct bfd_link_info *info)
   s = bfd_make_section_anyway_with_flags (abfd,
                                          (bed->rela_plts_and_copies_p
                                           ? ".rela.got" : ".rel.got"),
-                                         (bed->dynamic_sec_flags
-                                          | SEC_READONLY));
+                                         flags | SEC_READONLY);
   if (s == NULL
       || !bfd_set_section_alignment (s, bed->s->log_file_align))
     return false;
@@ -397,8 +396,7 @@ _bfd_elf_link_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
   if (info->enable_dt_relr)
     {
       s = bfd_make_section_anyway_with_flags (abfd, ".relr.dyn",
-                                             (bed->dynamic_sec_flags
-                                              | SEC_READONLY));
+                                             flags | SEC_READONLY);
       if (s == NULL
          || !bfd_set_section_alignment (s, bed->s->log_file_align))
        return false;