Set __ehdr_start rel_from_abs earlier
authorAlan Modra <amodra@gmail.com>
Tue, 25 Jan 2022 23:55:24 +0000 (10:25 +1030)
committerAlan Modra <amodra@gmail.com>
Fri, 28 Jan 2022 06:30:55 +0000 (17:00 +1030)
This is just a tidy, making the __ehdr_start symbol flag tweaks all in
one place.

* ldelf.c (ldelf_before_allocation): Don't set rel_from_abs
for __ehdr_start.
* ldlang.c (lang_symbol_tweaks): Set it here instead.

ld/ldelf.c
ld/ldlang.c

index 121c25d948fc417df93f2abb4b309e0419c1d4f7..33c6a9f1f467f77a41f5adfa411f3e3b69aacb52 100644 (file)
@@ -1619,7 +1619,6 @@ ldelf_before_allocation (char *audit, char *depaudit,
                      sizeof ehdr_start_save_u);
              ehdr_start->type = bfd_link_hash_defined;
              /* It will be converted to section-relative later.  */
-             ehdr_start->rel_from_abs = 1;
              ehdr_start->u.def.section = bfd_abs_section_ptr;
              ehdr_start->u.def.value = 0;
            }
index 4e6511ba4fffcfb223fe10976d910eba196f8e7f..5dd3df12a0f8a9dff4bab2818b89d011b8857776 100644 (file)
@@ -7022,6 +7022,7 @@ lang_symbol_tweaks (void)
            h->other = (h->other & ~ELF_ST_VISIBILITY (-1)) | STV_HIDDEN;
          h->def_regular = 1;
          h->root.linker_def = 1;
+         h->root.rel_from_abs = 1;
        }
     }
 }