From 9a73315161bc07d958060847ae01996312e1b30f Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Tue, 15 Oct 2019 15:57:35 +1030 Subject: remove more xmalloc in bfd Also fixes m68hc1x printf arguments which would have bombed when compiling on a 32-bit host with --enable-64-bit-bfd. bfd/ PR 24955 * elf32-arm.c (set_cmse_veneer_addr_from_implib): Use bfd_malloc rather than xmalloc. * elf32-m68hc1x.c (reloc_warning): New function. (elf32_m68hc11_relocate_section): Use it here. Cast bfd_vma values corresponding to %lx in format strings. * elf32-nds32.c (nds32_insertion_sort): Use a stack temporary. gas/ * config/tc-nds32.c (nds32_set_section_relocs): Use relocs and n parameters rather than equivalent sec->orelocation and sec->reloc_count. Don't sort for n <= 1. Tidy. --- gas/ChangeLog | 6 ++++++ gas/config/tc-nds32.c | 12 ++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) (limited to 'gas') diff --git a/gas/ChangeLog b/gas/ChangeLog index 3a1183b..33cc6ff 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,9 @@ +2019-10-15 Alan Modra + + * config/tc-nds32.c (nds32_set_section_relocs): Use relocs and n + parameters rather than equivalent sec->orelocation and + sec->reloc_count. Don't sort for n <= 1. Tidy. + 2019-10-09 Nick Clifton PR 25041 diff --git a/gas/config/tc-nds32.c b/gas/config/tc-nds32.c index 36ed58a..a75dd9a 100644 --- a/gas/config/tc-nds32.c +++ b/gas/config/tc-nds32.c @@ -7565,13 +7565,13 @@ compar_relent (const void *lhs, const void *rhs) relocation. */ void -nds32_set_section_relocs (asection *sec, arelent ** relocs ATTRIBUTE_UNUSED, - unsigned int n ATTRIBUTE_UNUSED) +nds32_set_section_relocs (asection *sec ATTRIBUTE_UNUSED, + arelent **relocs, unsigned int n) { - bfd *abfd ATTRIBUTE_UNUSED = sec->owner; - if (bfd_section_flags (sec) & (flagword) SEC_RELOC) - nds32_insertion_sort (sec->orelocation, sec->reloc_count, - sizeof (arelent**), compar_relent); + if (n <= 1) + return; + + nds32_insertion_sort (relocs, n, sizeof (*relocs), compar_relent); } long -- cgit v1.1