Avoid ubsan bug complaining about &p->field
[deliverable/binutils-gdb.git] / ld / emultempl / mmo.em
index 62ee144416be39005aa665bfa2b2fb21fdb459ce..247d8a8c0bf3f0452773c33d29f0078d6b7c516e 100644 (file)
@@ -116,9 +116,7 @@ mmo_place_orphan (asection *s,
            && (nexts->flags & SEC_EXCLUDE) == 0
            && ((nexts->flags ^ flags) & (SEC_LOAD | SEC_ALLOC)) == 0
            && (nexts->owner->flags & DYNAMIC) == 0
-           && nexts->owner->usrdata != NULL
-           && !(((lang_input_statement_type *) nexts->owner->usrdata)
-                ->flags.just_syms))
+           && !bfd_input_just_syms (nexts->owner))
          flags = (((flags ^ SEC_READONLY) | (nexts->flags ^ SEC_READONLY))
                   ^ SEC_READONLY);
     }
@@ -165,7 +163,7 @@ mmo_place_orphan (asection *s,
 
          /* We have to find the oss before this one, so we can use that as
             "after".  */
-         for (lookup = &lang_os_list.head->output_section_statement;
+         for (lookup = (void *) lang_os_list.head;
               lookup != NULL && lookup->next != before;
               lookup = lookup->next)
            ;
@@ -192,10 +190,10 @@ mmo_place_orphan (asection *s,
    paper over the bug similarly.  */
 
 static void
-mmo_wipe_sec_reloc_flag (bfd *abfd, asection *sec, void *ptr ATTRIBUTE_UNUSED)
+mmo_wipe_sec_reloc_flag (bfd *abfd ATTRIBUTE_UNUSED, asection *sec,
+                        void *ptr ATTRIBUTE_UNUSED)
 {
-  bfd_set_section_flags (abfd, sec,
-                        bfd_get_section_flags (abfd, sec) & ~SEC_RELOC);
+  bfd_set_section_flags (sec, bfd_section_flags (sec) & ~SEC_RELOC);
 }
 
 /* Iterate with bfd_map_over_sections over mmo_wipe_sec_reloc_flag... */
This page took 0.024189 seconds and 4 git commands to generate.