+2018-09-17  Alan Modra  <amodra@gmail.com>
+
+       * testsuite/lib/binutils-common.exp (is_som_format): New proc.
+       (run_dump_test): Correct target test for alternate .comm syntax.
+       (get_standard_section_names): Handle som format.
+       * testsuite/lib/utils-lib.exp (default_binutils_assemble_flags):
+       Correct target test for alternate .comm syntax.
+
 2018-09-17  Alan Modra  <amodra@gmail.com>
 
        * testsuite/binutils-all/strip-13mips64.s: Add section flags
 
     return 1
 }
 
+proc is_som_format {} {
+    if { ![istarget hppa*-*-*] || [istarget hppa*64*-*-*] } {
+       return 0;
+    }
+    if { [istarget *-*-osf*] \
+            || [istarget {*-*-h[ip]ux*}] \
+            || [istarget *-*-mpeix*] \
+            || [istarget *-*-bsd*] } {
+       return 1;
+    }
+    return 0;
+}
+
 # True if the object format is known to be 64-bit ELF.
 #
 proc is_elf64 { binary_file } {
                set cmdret 1
            }
        } else {
-           if { [istarget "hppa*-*-*"] && ![istarget "*-*-linux*" ] } {
+           if { [istarget "hppa*-*-*"] \
+                    && ![istarget "*-*-linux*"] \
+                    && ![istarget "*-*-netbsd*" ] } {
                set cmd "sed -e 's/^\[   \]*\.comm \\(\[^,\]*\\),\\(.*\\)/\\1 .comm \\2/' < $sourcefile > tmpdir/asm.s"
                send_log "$cmd\n"
                set cmdret [remote_exec host [concat sh -c [list "$cmd"]]]
     if [istarget "rx-*-*"] {
        return { "P" "D_1" "B_1" }
     }
-    if [istarget "alpha*-*-*vms*"] {
-       # Double quote: for TCL and for sh.
-       return { "\\\$CODE\\\$" "\\\$DATA\\\$" "\\\$BSS\\\$" }
+    if { [istarget "alpha*-*-*vms*"] || [is_som_format] } {
+       return { {\$CODE\$} {\$DATA\$} {\$BSS\$} }
     }
     return
 }
 
     # This is a hack in that it won't scale well if other targets need
     # similar transformations to assemble.  We'll generalize the hack
     # if/when other targets need similar handling.
-    if { [istarget "hppa*-*-*"] && ![istarget "*-*-linux*" ] } then {
+    if { [istarget "hppa*-*-*"] \
+            && ![istarget "*-*-linux*"] \
+            && ![istarget "*-*-netbsd*" ] } {
         set sed_file $srcdir/config/hppa.sed
        send_log "sed -f $sed_file < $source > asm.s\n"
        verbose "sed -f $sed_file < $source > asm.s"
 
+2018-09-17  Alan Modra  <amodra@gmail.com>
+
+       * testsuite/gas/all/gas.exp (redef3): Don't xfail for hppa.
+       (octa): Run for hppa.
+       * testsuite/gas/elf/elf.exp (common1, common2): Likewise.
+       * testsuite/gas/elf/symver.d: Delete notarget.
+
 2018-09-17  Nick Clifton  <nickc@redhat.com>
 
        * testuite/gas/elf/group0a.d: Add extra details to the test
 
        setup_xfail "riscv*-*-*" "rx-*-*" "vax*-*-*" "xgate*-*-*" "z8k-*-*"
        # rs6000-aix disallows redefinition via .comm.
        setup_xfail "*-*-aix*"
-       # SOM uses a different syntax for .comm
-       setup_xfail "hppa*-*-hpux*"
        # These targets fail redef3 because section contents for the
        # word referencing the .comm sym is not zero and/or its reloc
        # has a non-zero addend.  Relaxing the test would hide real
 }
 
 run_dump_test quad
-
-# som doesn't use .data section.
-case $target_triplet in {
-    { hppa*64*-*-* } {
-       run_dump_test octa
-    }
-    { hppa*-*-hpux* } { }
-    default {
-       run_dump_test octa
-    }
-}
+run_dump_test octa
 
 # .set works differently on some targets.
 case $target_triplet in {
 
 
     run_dump_test "missing-build-notes"
     
+    run_dump_test "common1"
+    run_dump_test "common2"
+
     # hpux has a non-standard common directive.
     if { ![istarget "*-*-hpux*"] } then {
-       run_dump_test "common1"
-       run_dump_test "common2"
        run_dump_test "common3a"
        run_dump_test "common3b"
        run_dump_test "common4a"
 
 #objdump: --syms
 #name: ELF symbol versioning
-#notarget: hppa64*-*-hpux*
 #
 # The #... and #pass are there to match extra symbols inserted by
 # some toolchains, eg the mips-elf port will add .reginfo and .ptrd
 
+2018-09-17  Alan Modra  <amodra@gmail.com>
+
+       * testsuite/ld-elf/comm-data5.d: Remove notarget for hppa.
+       * testsuite/ld-scripts/defined6.d: Likewise.
+
 2018-09-17  Nick Clifton  <nickc@redhat.com>
 
        * testuite/ld/ld-elf/audit.exp: Differentiate the names of the
 
 #source: comm-data5.s
 #ld: 
 #readelf: -r
-#notarget: hppa64*-*-hpux*
 #xfail: frv-*-*linux*
 
 There are no relocations in this file.
 
 #source: defined6.s
 #ld: -T defined6.t
 #nm: -B
-#notarget: hppa*-hpux*
-# hppa64-hpux has a different .comm
 
 # Check that DEFINED works with various symbol types
 #...