public inbox for gdb-testers@sourceware.org help / color / mirror / Atom feed
From: gdb-buildbot@sergiodj.net To: gdb-testers@sourceware.org Subject: [binutils-gdb] bfd macro conversion to inline functions, asymbol Date: Fri, 20 Sep 2019 09:27:00 -0000 [thread overview] Message-ID: <af30dc128be191dc6179763203035ff62c634284@gdb-build> (raw) *** TEST RESULTS FOR COMMIT af30dc128be191dc6179763203035ff62c634284 *** commit af30dc128be191dc6179763203035ff62c634284 Author: Alan Modra <amodra@gmail.com> AuthorDate: Thu Sep 19 12:15:16 2019 +0930 Commit: Alan Modra <amodra@gmail.com> CommitDate: Fri Sep 20 18:04:02 2019 +0930 bfd macro conversion to inline functions, asymbol * bfd-in.h (bfd_asymbol_section, bfd_asymbol_value, bfd_asymbol_name), (bfd_asymbol_bfd, bfd_asymbol_flavour, bfd_set_asymbol_name): Delete. * bfd.c (bfd_asymbol_section, bfd_asymbol_value, bfd_asymbol_name), (bfd_asymbol_bfd, bfd_set_asymbol_name): New inline functions. * targets.c (bfd_asymbol_flavour): Likewise. * bfd-in2.h: Regenerate. diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 1c700dbfff..5222063bf0 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,12 @@ +2019-09-20 Alan Modra <amodra@gmail.com> + + * bfd-in.h (bfd_asymbol_section, bfd_asymbol_value, bfd_asymbol_name), + (bfd_asymbol_bfd, bfd_asymbol_flavour, bfd_set_asymbol_name): Delete. + * bfd.c (bfd_asymbol_section, bfd_asymbol_value, bfd_asymbol_name), + (bfd_asymbol_bfd, bfd_set_asymbol_name): New inline functions. + * targets.c (bfd_asymbol_flavour): Likewise. + * bfd-in2.h: Regenerate. + 2019-09-20 Alan Modra <amodra@gmail.com> * archive.c (bfd_generic_archive_p): Use bfd_set_thin_archive. diff --git a/bfd/bfd-in.h b/bfd/bfd-in.h index 34c1c3ad0e..e9ada8d27f 100644 --- a/bfd/bfd-in.h +++ b/bfd/bfd-in.h @@ -237,19 +237,6 @@ typedef unsigned long symindex; #define BFD_NO_MORE_SYMBOLS ((symindex) ~0) -/* General purpose part of a symbol X; - target specific parts are in libcoff.h, libaout.h, etc. */ - -#define bfd_asymbol_section(sy) ((sy)->section) -#define bfd_asymbol_value(sy) ((sy)->section->vma + (sy)->value) -#define bfd_asymbol_name(sy) ((sy)->name) -#define bfd_asymbol_bfd(sy) ((sy)->the_bfd) -#define bfd_asymbol_flavour(sy) \ - (((sy)->flags & BSF_SYNTHETIC) != 0 \ - ? bfd_target_unknown_flavour \ - : (sy)->the_bfd->xvec->flavour) -#define bfd_set_asymbol_name(sy, n) do { (sy)->name = (n); } while (0) - /* A canonical archive symbol. */ /* This is a type pun with struct ranlib on purpose! */ typedef struct carsym diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h index 4f158679b2..5ac3f41b7a 100644 --- a/bfd/bfd-in2.h +++ b/bfd/bfd-in2.h @@ -244,19 +244,6 @@ typedef unsigned long symindex; #define BFD_NO_MORE_SYMBOLS ((symindex) ~0) -/* General purpose part of a symbol X; - target specific parts are in libcoff.h, libaout.h, etc. */ - -#define bfd_asymbol_section(sy) ((sy)->section) -#define bfd_asymbol_value(sy) ((sy)->section->vma + (sy)->value) -#define bfd_asymbol_name(sy) ((sy)->name) -#define bfd_asymbol_bfd(sy) ((sy)->the_bfd) -#define bfd_asymbol_flavour(sy) \ - (((sy)->flags & BSF_SYNTHETIC) != 0 \ - ? bfd_target_unknown_flavour \ - : (sy)->the_bfd->xvec->flavour) -#define bfd_set_asymbol_name(sy, n) do { (sy)->name = (n); } while (0) - /* A canonical archive symbol. */ /* This is a type pun with struct ranlib on purpose! */ typedef struct carsym @@ -7381,6 +7368,36 @@ bfd_set_usrdata (bfd *abfd, void *val) abfd->usrdata = val; } +static inline asection * +bfd_asymbol_section (const asymbol *sy) +{ + return sy->section; +} + +static inline bfd_vma +bfd_asymbol_value (const asymbol *sy) +{ + return sy->section->vma + sy->value; +} + +static inline const char * +bfd_asymbol_name (const asymbol *sy) +{ + return sy->name; +} + +static inline struct bfd * +bfd_asymbol_bfd (const asymbol *sy) +{ + return sy->the_bfd; +} + +static inline void +bfd_set_asymbol_name (asymbol *sy, const char *name) +{ + sy->name = name; +} + typedef enum bfd_error { @@ -8135,6 +8152,14 @@ bfd_get_symbol_leading_char (const bfd *abfd) return abfd->xvec->symbol_leading_char; } +static inline enum bfd_flavour +bfd_asymbol_flavour (const asymbol *sy) +{ + if ((sy->flags & BSF_SYNTHETIC) != 0) + return bfd_target_unknown_flavour; + return sy->the_bfd->xvec->flavour; +} + bfd_boolean bfd_set_default_target (const char *name); const bfd_target *bfd_find_target (const char *target_name, bfd *abfd); diff --git a/bfd/bfd.c b/bfd/bfd.c index c11274c187..9270e118d3 100644 --- a/bfd/bfd.c +++ b/bfd/bfd.c @@ -447,6 +447,36 @@ CODE_FRAGMENT . abfd->usrdata = val; .} . +.static inline asection * +.bfd_asymbol_section (const asymbol *sy) +.{ +. return sy->section; +.} +. +.static inline bfd_vma +.bfd_asymbol_value (const asymbol *sy) +.{ +. return sy->section->vma + sy->value; +.} +. +.static inline const char * +.bfd_asymbol_name (const asymbol *sy) +.{ +. return sy->name; +.} +. +.static inline struct bfd * +.bfd_asymbol_bfd (const asymbol *sy) +.{ +. return sy->the_bfd; +.} +. +.static inline void +.bfd_set_asymbol_name (asymbol *sy, const char *name) +.{ +. sy->name = name; +.} +. */ #include "sysdep.h" diff --git a/bfd/targets.c b/bfd/targets.c index 116a5c34de..717657fba4 100644 --- a/bfd/targets.c +++ b/bfd/targets.c @@ -644,6 +644,14 @@ to find an alternative output format that is suitable. . return abfd->xvec->symbol_leading_char; .} . +.static inline enum bfd_flavour +.bfd_asymbol_flavour (const asymbol *sy) +.{ +. if ((sy->flags & BSF_SYNTHETIC) != 0) +. return bfd_target_unknown_flavour; +. return sy->the_bfd->xvec->flavour; +.} +. */ /* All known xvecs (even those that don't compile on all systems).
next reply other threads:[~2019-09-20 8:59 UTC|newest] Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top 2019-09-20 9:27 gdb-buildbot [this message] 2019-09-20 9:18 ` Failures on RHEL-s390x-m64, branch master gdb-buildbot 2019-09-20 10:32 ` Failures on Ubuntu-Aarch64-m64, " gdb-buildbot 2019-09-20 11:32 ` Failures on Debian-s390x-m64, " gdb-buildbot 2019-09-20 12:59 ` Failures on Debian-s390x-native-extended-gdbserver-m64, " gdb-buildbot 2019-09-20 13:18 ` Failures on Debian-s390x-native-gdbserver-m64, " gdb-buildbot 2019-09-20 19:21 ` Failures on Fedora-x86_64-m64, " gdb-buildbot 2019-09-20 19:37 ` Failures on Fedora-x86_64-m32, " gdb-buildbot 2019-09-20 19:38 ` Failures on Fedora-x86_64-native-extended-gdbserver-m32, " gdb-buildbot 2019-09-20 19:38 ` Failures on Fedora-x86_64-native-gdbserver-m32, " gdb-buildbot 2019-09-20 19:40 ` Failures on Fedora-x86_64-native-extended-gdbserver-m64, " gdb-buildbot
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=af30dc128be191dc6179763203035ff62c634284@gdb-build \ --to=gdb-buildbot@sergiodj.net \ --cc=gdb-testers@sourceware.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).