[binutils-gdb] _bfd_xcoff_read_ar_hdr tidy

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

[binutils-gdb] _bfd_xcoff_read_ar_hdr tidy

gdb-buildbot
*** TEST RESULTS FOR COMMIT 05f52dc2e1359fc4f69fab5c39fdfdf5efe93a15 ***

commit 05f52dc2e1359fc4f69fab5c39fdfdf5efe93a15
Author:     Alan Modra <[hidden email]>
AuthorDate: Thu Feb 27 14:11:35 2020 +1030
Commit:     Alan Modra <[hidden email]>
CommitDate: Thu Feb 27 17:05:08 2020 +1030

    _bfd_xcoff_read_ar_hdr tidy
   
            * coff-rs6000.c (_bfd_xcoff_read_ar_hdr): Put all data in one
            malloc'd block.

diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index ff03baa0dc..e5cf5e125e 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,8 @@
+2020-02-27  Alan Modra  <[hidden email]>
+
+ * coff-rs6000.c (_bfd_xcoff_read_ar_hdr): Put all data in one
+ malloc'd block.
+
 2020-02-27  Alan Modra  <[hidden email]>
 
  * bfd.c (bfd_stat_arch_elt): Use vector of containing archive,
diff --git a/bfd/coff-rs6000.c b/bfd/coff-rs6000.c
index 8b8f472504..1cc708ce1b 100644
--- a/bfd/coff-rs6000.c
+++ b/bfd/coff-rs6000.c
@@ -1491,32 +1491,23 @@ _bfd_xcoff_read_ar_hdr (bfd *abfd)
 {
   bfd_size_type namlen;
   struct areltdata *ret;
-  bfd_size_type amt = sizeof (struct areltdata);
-
-  ret = (struct areltdata *) bfd_zmalloc (amt);
-  if (ret == NULL)
-    return NULL;
+  bfd_size_type amt;
 
   if (! xcoff_big_format_p (abfd))
     {
       struct xcoff_ar_hdr hdr;
       struct xcoff_ar_hdr *hdrp;
 
-      if (bfd_bread (&hdr, (bfd_size_type) SIZEOF_AR_HDR, abfd)
-  != SIZEOF_AR_HDR)
- {
-  free (ret);
-  return NULL;
- }
+      if (bfd_bread (&hdr, SIZEOF_AR_HDR, abfd) != SIZEOF_AR_HDR)
+ return NULL;
 
       GET_VALUE_IN_FIELD (namlen, hdr.namlen, 10);
-      amt = SIZEOF_AR_HDR + namlen + 1;
-      hdrp = (struct xcoff_ar_hdr *) bfd_alloc (abfd, amt);
-      if (hdrp == NULL)
- {
-  free (ret);
-  return NULL;
- }
+      amt = sizeof (struct areltdata) + SIZEOF_AR_HDR + namlen + 1;
+      ret = (struct areltdata *) bfd_malloc (amt);
+      if (ret == NULL)
+ return ret;
+
+      hdrp = (struct xcoff_ar_hdr *) (ret + 1);
       memcpy (hdrp, &hdr, SIZEOF_AR_HDR);
       if (bfd_bread ((char *) hdrp + SIZEOF_AR_HDR, namlen, abfd) != namlen)
  {
@@ -1534,21 +1525,16 @@ _bfd_xcoff_read_ar_hdr (bfd *abfd)
       struct xcoff_ar_hdr_big hdr;
       struct xcoff_ar_hdr_big *hdrp;
 
-      if (bfd_bread (&hdr, (bfd_size_type) SIZEOF_AR_HDR_BIG, abfd)
-  != SIZEOF_AR_HDR_BIG)
- {
-  free (ret);
-  return NULL;
- }
+      if (bfd_bread (&hdr, SIZEOF_AR_HDR_BIG, abfd) != SIZEOF_AR_HDR_BIG)
+ return NULL;
 
       GET_VALUE_IN_FIELD (namlen, hdr.namlen, 10);
-      amt = SIZEOF_AR_HDR_BIG + namlen + 1;
-      hdrp = (struct xcoff_ar_hdr_big *) bfd_alloc (abfd, amt);
-      if (hdrp == NULL)
- {
-  free (ret);
-  return NULL;
- }
+      amt = sizeof (struct areltdata) + SIZEOF_AR_HDR_BIG + namlen + 1;
+      ret = (struct areltdata *) bfd_malloc (amt);
+      if (ret == NULL)
+ return ret;
+
+      hdrp = (struct xcoff_ar_hdr_big *) (ret + 1);
       memcpy (hdrp, &hdr, SIZEOF_AR_HDR_BIG);
       if (bfd_bread ((char *) hdrp + SIZEOF_AR_HDR_BIG, namlen, abfd) != namlen)
  {
Reply | Threaded
Open this post in threaded view
|

Failures on Fedora-x86_64-cc-with-index, branch master

gdb-buildbot
Buildername:
        Fedora-x86_64-cc-with-index

Worker:
        fedora-x86-64-4

Full Build URL:
        https://gdb-buildbot.osci.io/#builders/20/builds/2273

Author:
        Alan Modra <[hidden email]>

Commit tested:
        05f52dc2e1359fc4f69fab5c39fdfdf5efe93a15

Subject of commit:
        _bfd_xcoff_read_ar_hdr tidy

Testsuite logs (gdb.sum, gdb.log and others):
        https://gdb-buildbot.osci.io/results/Fedora-x86_64-cc-with-index/05/05f52dc2e1359fc4f69fab5c39fdfdf5efe93a15/

*** Diff to previous build ***
==============================================
PASS -> KFAIL: gdb.threads/omp-par-scope.exp: nested_func: 2nd call: 2nd thread: print k
PASS -> KFAIL: gdb.threads/omp-par-scope.exp: nested_func: 2nd call: 2nd thread: print r
PASS -> KFAIL: gdb.threads/omp-par-scope.exp: nested_func: 2nd call: 2nd thread: print z
==============================================

*** Complete list of XFAILs for this builder ***

To obtain the list of XFAIL tests for this builder, go to:

        <https://gdb-buildbot.osci.io/results/Fedora-x86_64-cc-with-index/05/05f52dc2e1359fc4f69fab5c39fdfdf5efe93a15//xfail.gz>

You can also see a pretty-printed version of the list, with more information
about each XFAIL, by going to:

        <https://gdb-buildbot.osci.io/results/Fedora-x86_64-cc-with-index/05/05f52dc2e1359fc4f69fab5c39fdfdf5efe93a15//xfail.table.gz>

Reply | Threaded
Open this post in threaded view
|

Failures on Fedora-i686, branch master

gdb-buildbot
In reply to this post by gdb-buildbot
Buildername:
        Fedora-i686

Worker:
        fedora-x86-64-1

Full Build URL:
        https://gdb-buildbot.osci.io/#builders/18/builds/2326

Author:
        Alan Modra <[hidden email]>

Commit tested:
        05f52dc2e1359fc4f69fab5c39fdfdf5efe93a15

Subject of commit:
        _bfd_xcoff_read_ar_hdr tidy

Testsuite logs (gdb.sum, gdb.log and others):
        https://gdb-buildbot.osci.io/results/Fedora-i686/05/05f52dc2e1359fc4f69fab5c39fdfdf5efe93a15/

*** Diff to previous build ***
==============================================
PASS -> KFAIL: gdb.threads/process-dies-while-handling-bp.exp: non_stop=on: cond_bp_target=0: inferior 1 exited
==============================================

*** Complete list of XFAILs for this builder ***

To obtain the list of XFAIL tests for this builder, go to:

        <https://gdb-buildbot.osci.io/results/Fedora-i686/05/05f52dc2e1359fc4f69fab5c39fdfdf5efe93a15//xfail.gz>

You can also see a pretty-printed version of the list, with more information
about each XFAIL, by going to:

        <https://gdb-buildbot.osci.io/results/Fedora-i686/05/05f52dc2e1359fc4f69fab5c39fdfdf5efe93a15//xfail.table.gz>

Reply | Threaded
Open this post in threaded view
|

Failures on Fedora-x86_64-m32, branch master

gdb-buildbot
In reply to this post by gdb-buildbot
Buildername:
        Fedora-x86_64-m32

Worker:
        fedora-x86-64-4

Full Build URL:
        https://gdb-buildbot.osci.io/#builders/17/builds/2322

Author:
        Alan Modra <[hidden email]>

Commit tested:
        05f52dc2e1359fc4f69fab5c39fdfdf5efe93a15

Subject of commit:
        _bfd_xcoff_read_ar_hdr tidy

Testsuite logs (gdb.sum, gdb.log and others):
        https://gdb-buildbot.osci.io/results/Fedora-x86_64-m32/05/05f52dc2e1359fc4f69fab5c39fdfdf5efe93a15/

*** Diff to previous build ***
==============================================
PASS -> KFAIL: gdb.threads/non-ldr-exit.exp: program exits normally
==============================================

*** Complete list of XFAILs for this builder ***

To obtain the list of XFAIL tests for this builder, go to:

        <https://gdb-buildbot.osci.io/results/Fedora-x86_64-m32/05/05f52dc2e1359fc4f69fab5c39fdfdf5efe93a15//xfail.gz>

You can also see a pretty-printed version of the list, with more information
about each XFAIL, by going to:

        <https://gdb-buildbot.osci.io/results/Fedora-x86_64-m32/05/05f52dc2e1359fc4f69fab5c39fdfdf5efe93a15//xfail.table.gz>

Reply | Threaded
Open this post in threaded view
|

Failures on Fedora-x86_64-m64, branch master

gdb-buildbot
In reply to this post by gdb-buildbot
Buildername:
        Fedora-x86_64-m64

Worker:
        fedora-x86-64-1

Full Build URL:
        https://gdb-buildbot.osci.io/#builders/3/builds/2383

Author:
        Alan Modra <[hidden email]>

Commit tested:
        05f52dc2e1359fc4f69fab5c39fdfdf5efe93a15

Subject of commit:
        _bfd_xcoff_read_ar_hdr tidy

Testsuite logs (gdb.sum, gdb.log and others):
        https://gdb-buildbot.osci.io/results/Fedora-x86_64-m64/05/05f52dc2e1359fc4f69fab5c39fdfdf5efe93a15/

*** Diff to previous build ***
==============================================
PASS -> UNRESOLVED: gdb.base/reread.exp: opts= "" "" : second pass: breakpoint foo in first file
PASS -> UNRESOLVED: gdb.base/reread.exp: opts= "-fPIE" "ldflags=-pie" : second pass: breakpoint foo in first file
PASS -> FAIL: gdb.dwarf2/implptr-64bit.exp: d3o4a8r4t1
PASS -> KFAIL: gdb.threads/non-ldr-exit.exp: program exits normally
PASS -> KFAIL: gdb.threads/omp-par-scope.exp: multi_scope: second thread: print i02
PASS -> KFAIL: gdb.threads/omp-par-scope.exp: multi_scope: second thread: print i12
PASS -> KFAIL: gdb.threads/omp-par-scope.exp: multi_scope: second thread: print i22
PASS -> KFAIL: gdb.threads/omp-par-scope.exp: nested_func: 1st call: 2nd thread: print k
PASS -> KFAIL: gdb.threads/omp-par-scope.exp: nested_func: 1st call: 2nd thread: print r
PASS -> KFAIL: gdb.threads/omp-par-scope.exp: nested_func: 1st call: 2nd thread: print z
PASS -> KFAIL: gdb.threads/omp-par-scope.exp: nested_parallel: inner_threads: 1st stop: print i
PASS -> KFAIL: gdb.threads/omp-par-scope.exp: nested_parallel: inner_threads: 1st stop: print j
==============================================

*** Complete list of XFAILs for this builder ***

To obtain the list of XFAIL tests for this builder, go to:

        <https://gdb-buildbot.osci.io/results/Fedora-x86_64-m64/05/05f52dc2e1359fc4f69fab5c39fdfdf5efe93a15//xfail.gz>

You can also see a pretty-printed version of the list, with more information
about each XFAIL, by going to:

        <https://gdb-buildbot.osci.io/results/Fedora-x86_64-m64/05/05f52dc2e1359fc4f69fab5c39fdfdf5efe93a15//xfail.table.gz>

Reply | Threaded
Open this post in threaded view
|

Failures on Fedora-x86_64-native-extended-gdbserver-m32, branch master

gdb-buildbot
In reply to this post by gdb-buildbot
Buildername:
        Fedora-x86_64-native-extended-gdbserver-m32

Worker:
        fedora-x86-64-4

Full Build URL:
        https://gdb-buildbot.osci.io/#builders/4/builds/2218

Author:
        Alan Modra <[hidden email]>

Commit tested:
        05f52dc2e1359fc4f69fab5c39fdfdf5efe93a15

Subject of commit:
        _bfd_xcoff_read_ar_hdr tidy

Testsuite logs (gdb.sum, gdb.log and others):
        https://gdb-buildbot.osci.io/results/Fedora-x86_64-native-extended-gdbserver-m32/05/05f52dc2e1359fc4f69fab5c39fdfdf5efe93a15/

*** Diff to previous build ***
==============================================
UNRESOLVED -> FAIL: gdb.mi/mi-exec-run.exp: inferior-tty=main: mi=main: force-fail=1: run failure detected
UNRESOLVED -> FAIL: gdb.mi/mi-exec-run.exp: inferior-tty=main: mi=separate: force-fail=1: run failure detected
UNRESOLVED -> FAIL: gdb.mi/mi-exec-run.exp: inferior-tty=separate: mi=main: force-fail=1: run failure detected
UNRESOLVED -> FAIL: gdb.mi/mi-exec-run.exp: inferior-tty=separate: mi=separate: force-fail=1: run failure detected
PASS -> UNRESOLVED: gdb.threads/attach-into-signal.exp: threaded: attach
new FAIL: gdb.threads/attach-into-signal.exp: threaded: thread apply 2 print $_siginfo.si_signo
UNRESOLVED -> FAIL: gdb.threads/fork-plus-threads.exp: detach-on-fork=off: inferior 1 exited
new FAIL: gdb.threads/fork-plus-threads.exp: detach-on-fork=off: only inferior 1 left
==============================================

*** Complete list of XFAILs for this builder ***

To obtain the list of XFAIL tests for this builder, go to:

        <https://gdb-buildbot.osci.io/results/Fedora-x86_64-native-extended-gdbserver-m32/05/05f52dc2e1359fc4f69fab5c39fdfdf5efe93a15//xfail.gz>

You can also see a pretty-printed version of the list, with more information
about each XFAIL, by going to:

        <https://gdb-buildbot.osci.io/results/Fedora-x86_64-native-extended-gdbserver-m32/05/05f52dc2e1359fc4f69fab5c39fdfdf5efe93a15//xfail.table.gz>

Reply | Threaded
Open this post in threaded view
|

Failures on Fedora-x86_64-native-extended-gdbserver-m64, branch master

Sourceware - gdb-testers mailing list
In reply to this post by gdb-buildbot
Buildername:
        Fedora-x86_64-native-extended-gdbserver-m64

Worker:
        fedora-x86-64-1

Full Build URL:
        https://gdb-buildbot.osci.io/#builders/2/builds/2218

Author:
        Alan Modra <[hidden email]>

Commit tested:
        05f52dc2e1359fc4f69fab5c39fdfdf5efe93a15

Subject of commit:
        _bfd_xcoff_read_ar_hdr tidy

Testsuite logs (gdb.sum, gdb.log and others):
        https://gdb-buildbot.osci.io/results/Fedora-x86_64-native-extended-gdbserver-m64/05/05f52dc2e1359fc4f69fab5c39fdfdf5efe93a15/

*** Diff to previous build ***
==============================================
new FAIL: gdb.base/break-interp.exp: LDprelinkNOdebugIN: BINprelinkNOdebugNOpieNO: INNER: symbol-less: entry point reached
new FAIL: gdb.base/break-interp.exp: LDprelinkNOdebugIN: BINprelinkNOdebugNOpieYES: INNER: symbol-less: entry point reached
PASS -> UNRESOLVED: gdb.base/reread.exp: opts= "" "" : second pass: breakpoint foo in first file
PASS -> UNRESOLVED: gdb.base/reread.exp: opts= "-fPIE" "ldflags=-pie" : second pass: breakpoint foo in first file
FAIL -> UNRESOLVED: gdb.mi/mi-exec-run.exp: inferior-tty=main: mi=main: force-fail=1: run failure detected
FAIL -> UNRESOLVED: gdb.mi/mi-exec-run.exp: inferior-tty=main: mi=separate: force-fail=1: run failure detected
FAIL -> UNRESOLVED: gdb.mi/mi-exec-run.exp: inferior-tty=separate: mi=main: force-fail=1: run failure detected
FAIL -> UNRESOLVED: gdb.mi/mi-exec-run.exp: inferior-tty=separate: mi=separate: force-fail=1: run failure detected
PASS -> FAIL: gdb.multi/multi-re-run.exp: re_run_inf=1: iter=2: continue until exit
PASS -> FAIL: gdb.multi/multi-re-run.exp: re_run_inf=1: iter=2: print re_run_var_1
PASS -> FAIL: gdb.multi/multi-re-run.exp: re_run_inf=2: iter=2: continue until exit
PASS -> FAIL: gdb.multi/multi-re-run.exp: re_run_inf=2: iter=2: print re_run_var_2
PASS -> FAIL: gdb.multi/multi-term-settings.exp: inf1_how=attach: inf2_how=attach: stop with control-c
UNRESOLVED -> FAIL: gdb.threads/fork-plus-threads.exp: detach-on-fork=off: inferior 1 exited
new FAIL: gdb.threads/fork-plus-threads.exp: detach-on-fork=off: only inferior 1 left
PASS -> KFAIL: gdb.threads/process-dies-while-handling-bp.exp: non_stop=off: cond_bp_target=0: inferior 1 exited
PASS -> FAIL: gdb.threads/thread-unwindonsignal.exp: continue until exit
==============================================

*** Complete list of XFAILs for this builder ***

To obtain the list of XFAIL tests for this builder, go to:

        <https://gdb-buildbot.osci.io/results/Fedora-x86_64-native-extended-gdbserver-m64/05/05f52dc2e1359fc4f69fab5c39fdfdf5efe93a15//xfail.gz>

You can also see a pretty-printed version of the list, with more information
about each XFAIL, by going to:

        <https://gdb-buildbot.osci.io/results/Fedora-x86_64-native-extended-gdbserver-m64/05/05f52dc2e1359fc4f69fab5c39fdfdf5efe93a15//xfail.table.gz>

Reply | Threaded
Open this post in threaded view
|

Failures on Ubuntu-Aarch64-native-gdbserver-m64, branch master

Sourceware - gdb-testers mailing list
In reply to this post by gdb-buildbot
Buildername:
        Ubuntu-Aarch64-native-gdbserver-m64

Worker:
        ubuntu-aarch64

Full Build URL:
        https://gdb-buildbot.osci.io/#builders/19/builds/2134

Author:
        Alan Modra <[hidden email]>

Commit tested:
        05f52dc2e1359fc4f69fab5c39fdfdf5efe93a15

Subject of commit:
        _bfd_xcoff_read_ar_hdr tidy

Testsuite logs (gdb.sum, gdb.log and others):
        https://gdb-buildbot.osci.io/results/Ubuntu-Aarch64-native-gdbserver-m64/05/05f52dc2e1359fc4f69fab5c39fdfdf5efe93a15/

*** Diff to previous build ***
==============================================
PASS -> FAIL: gdb.base/step-over-syscall.exp: detach-on-fork=off: follow-fork=parent: break cond on target : fork: pc after stepi matches insn addr after syscall
PASS -> FAIL: gdb.base/step-over-syscall.exp: detach-on-fork=on: follow-fork=parent: break cond on target : fork: pc after stepi matches insn addr after syscall
==============================================

*** Complete list of XFAILs for this builder ***

To obtain the list of XFAIL tests for this builder, go to:

        <https://gdb-buildbot.osci.io/results/Ubuntu-Aarch64-native-gdbserver-m64/05/05f52dc2e1359fc4f69fab5c39fdfdf5efe93a15//xfail.gz>

You can also see a pretty-printed version of the list, with more information
about each XFAIL, by going to:

        <https://gdb-buildbot.osci.io/results/Ubuntu-Aarch64-native-gdbserver-m64/05/05f52dc2e1359fc4f69fab5c39fdfdf5efe93a15//xfail.table.gz>

Reply | Threaded
Open this post in threaded view
|

Failures on Fedora-x86_64-native-gdbserver-m64, branch master

Sourceware - gdb-testers mailing list
In reply to this post by gdb-buildbot
Buildername:
        Fedora-x86_64-native-gdbserver-m64

Worker:
        fedora-x86-64-2

Full Build URL:
        https://gdb-buildbot.osci.io/#builders/22/builds/2220

Author:
        Alan Modra <[hidden email]>

Commit tested:
        05f52dc2e1359fc4f69fab5c39fdfdf5efe93a15

Subject of commit:
        _bfd_xcoff_read_ar_hdr tidy

Testsuite logs (gdb.sum, gdb.log and others):
        https://gdb-buildbot.osci.io/results/Fedora-x86_64-native-gdbserver-m64/05/05f52dc2e1359fc4f69fab5c39fdfdf5efe93a15/

*** Diff to previous build ***
==============================================
PASS -> KFAIL: gdb.threads/omp-par-scope.exp: multi_scope: first thread: print i02
PASS -> KFAIL: gdb.threads/omp-par-scope.exp: multi_scope: first thread: print i12
PASS -> KFAIL: gdb.threads/omp-par-scope.exp: multi_scope: first thread: print i22
PASS -> KFAIL: gdb.threads/omp-par-scope.exp: nested_func: 2nd call: 2nd thread: print k
PASS -> KFAIL: gdb.threads/omp-par-scope.exp: nested_func: 2nd call: 2nd thread: print r
PASS -> KFAIL: gdb.threads/omp-par-scope.exp: nested_func: 2nd call: 2nd thread: print z
PASS -> KFAIL: gdb.threads/omp-par-scope.exp: nested_parallel: inner_threads: 4th stop: print i
PASS -> KFAIL: gdb.threads/omp-par-scope.exp: nested_parallel: inner_threads: 4th stop: print j
PASS -> KFAIL: gdb.threads/omp-par-scope.exp: nested_parallel: outer_threads: outer stop: print i
PASS -> KFAIL: gdb.threads/omp-par-scope.exp: nested_parallel: outer_threads: outer stop: print j
PASS -> KFAIL: gdb.threads/process-dies-while-handling-bp.exp: non_stop=off: cond_bp_target=0: inferior 1 exited
PASS -> KFAIL: gdb.threads/process-dies-while-handling-bp.exp: non_stop=on: cond_bp_target=1: inferior 1 exited
==============================================

*** Complete list of XFAILs for this builder ***

To obtain the list of XFAIL tests for this builder, go to:

        <https://gdb-buildbot.osci.io/results/Fedora-x86_64-native-gdbserver-m64/05/05f52dc2e1359fc4f69fab5c39fdfdf5efe93a15//xfail.gz>

You can also see a pretty-printed version of the list, with more information
about each XFAIL, by going to:

        <https://gdb-buildbot.osci.io/results/Fedora-x86_64-native-gdbserver-m64/05/05f52dc2e1359fc4f69fab5c39fdfdf5efe93a15//xfail.table.gz>