+2021-02-15  Alan Modra  <amodra@gmail.com>
+
+       * elf32-nds32.c (nds32_get_section_contents): Replace
+       bfd_malloc_and_get_section with bfd_get_full_section_contents.
+       (nds32_elf_relax_delete_blanks): Init contents.
+       (nds32_elf_relax_section, nds32_relax_fp_as_gp): Likewise.
+
 2021-02-15  Alan Modra  <amodra@gmail.com>
 
        * coff-alpha.c (alpha_ecoff_get_relocated_section_contents): Use
 
       if (!(sect->flags & SEC_RELOC))
        continue;
 
+      contents = NULL;
       nds32_get_section_contents (abfd, sect, &contents, TRUE);
 
       for (irel = internal_relocs; irel < irelend; irel++)
     *contents_p = elf_section_data (sec)->this_hdr.contents;
   else
     {
-      if (!bfd_malloc_and_get_section (abfd, sec, contents_p))
+      if (!bfd_get_full_section_contents (abfd, sec, contents_p))
        return FALSE;
       if (cache)
        elf_section_data (sec)->this_hdr.contents = *contents_p;
   load_store_relax = table->load_store_relax;
 
   /* Get symbol table and section content.  */
+  contents = NULL;
   if (!nds32_get_section_contents (abfd, sec, &contents, TRUE)
       || !nds32_get_local_syms (abfd, sec, &isymbuf))
     goto error_return;
 
   symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
 
+  contents = NULL;
   if (!nds32_get_section_contents (abfd, sec, &contents, TRUE)
       || !nds32_get_local_syms (abfd, sec, &isymbuf))
     return FALSE;
 
+2021-02-15  Alan Modra  <amodra@gmail.com>
+
+       * testsuite/binutils-all/compress.exp: Remove nds32 xfails.
+       * testsuite/binutils-all/objdump.exp: Likewise.
+
 2021-02-14  Alan Modra  <amodra@gmail.com>
 
        * objdump.c (slurp_symtab): Don't add an extra entry for NULL
 
     }
 }
 
-setup_xfail "nds32*-*-*"
 set testname "objdump compress debug sections"
 set got [remote_exec host "$OBJDUMP -W ${compressedfile}.o" "" "/dev/null" "objdump.out"]
 if { [lindex $got 0] != 0 || ![string match "" [lindex $got 1]] } then {
     pass "$testname"
 }
 
-setup_xfail "nds32*-*-*"
 set testname "objdump compress debug sections 3"
 set got [remote_exec host "$OBJDUMP -W ${compressedfile3}.o" "" "/dev/null" "objdump.out"]
 if { [lindex $got 0] != 0 || ![string match "" [lindex $got 1]] } then {
     }
 }
 
-setup_xfail "nds32*-*-*"
 set testname "objcopy compress debug sections in archive with zlib-gabi"
 set got [binutils_run $OBJCOPY "--compress-debug-sections=zlib-gabi ${copyfile}gabi.a ${compressedcopyfile}gabi.a"]
 if ![string match "" $got] then {
     }
 }
 
-setup_xfail "nds32*-*-*"
 set testname "objdump compress debug sections 3 with zlib-gabi"
 set got [remote_exec host "$OBJDUMP -W ${compressedfile3}gabi.o" "" "/dev/null" "objdump.out"]
 if { [lindex $got 0] != 0 || ![string match "" [lindex $got 1]] } then {
 
        send_log "\n"
     }
 
-    setup_xfail "msp430-*-*" "nds32*-*-*"
+    setup_xfail "msp430-*-*"
     if { [regexp_diff objdump.out $srcdir/$subdir/dw2-ranges.W] } then {
        fail "objdump -W for debug_ranges"
     } else {