ld: replace wrong bfd_malloc in nto.em
authorClément Chigot <chigot@adacore.com>
Fri, 13 Oct 2023 14:43:32 +0000 (16:43 +0200)
committerClément Chigot <chigot@adacore.com>
Fri, 13 Oct 2023 14:50:23 +0000 (16:50 +0200)
xmalloc should be called in ld instead of bfd_malloc.

ld/ChangeLog:

* emultempl/nto.em (nto_lookup_QNX_note_section): Replace
bfd_malloc by xmalloc.

ld/emultempl/nto.em

index f4c76f18fc2fb540d438d4068a17bb6fd6ae11ee..273502dd802335f62b6aa8c45101497aa5933a5d 100644 (file)
@@ -98,7 +98,7 @@ nto_lookup_QNX_note_section(int type)
        continue;
 
       /* Verify that this is a QNX note of the expected type.  */
-      sec->contents = bfd_malloc(sec->size);
+      sec->contents = xmalloc(sec->size);
       if (!bfd_get_section_contents (sec->owner, sec, sec->contents, (file_ptr) 0,
                                     sec->size))
        einfo (_("%F%P: %pB: can't read contents of section .note: %E\n"),