diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2017-10-06 05:49:48 -0700 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2017-10-06 05:49:48 -0700 |
commit | e0d8f43169368abf354e596c7725dee1dd609cb8 (patch) | |
tree | 390d678808c82f91427105227758134b650af952 /bfd/elfxx-x86.h | |
parent | a1b85d282f408dfd18a27539874846197f7e4044 (diff) | |
download | binutils-e0d8f43169368abf354e596c7725dee1dd609cb8.zip binutils-e0d8f43169368abf354e596c7725dee1dd609cb8.tar.gz binutils-e0d8f43169368abf354e596c7725dee1dd609cb8.tar.bz2 |
Add "do/while(0);" to COPY_INPUT_RELOC_P/VERIFY_COPY_RELOC
Add "do/while(0);" to COPY_INPUT_RELOC_P/VERIFY_COPY_RELOC to avoid
potential dangling else problems.
* elfxx-x86.h (COPY_INPUT_RELOC_P): Add "do/while(0);".
(VERIFY_COPY_RELOC): Likewise.
Diffstat (limited to 'bfd/elfxx-x86.h')
-rw-r--r-- | bfd/elfxx-x86.h | 38 |
1 files changed, 23 insertions, 15 deletions
diff --git a/bfd/elfxx-x86.h b/bfd/elfxx-x86.h index ca270de..5dc21b0 100644 --- a/bfd/elfxx-x86.h +++ b/bfd/elfxx-x86.h @@ -198,24 +198,32 @@ /* Verify that the symbol has an entry in the procedure linkage table. */ #define VERIFY_PLT_ENTRY(INFO, H, PLT, GOTPLT, RELPLT, LOCAL_UNDEFWEAK) \ - if (((H)->dynindx == -1 \ - && !LOCAL_UNDEFWEAK \ - && !(((H)->forced_local || bfd_link_executable (INFO)) \ - && (H)->def_regular \ - && (H)->type == STT_GNU_IFUNC)) \ - || (PLT) == NULL \ - || (GOTPLT) == NULL \ - || (RELPLT) == NULL) \ - abort (); + do \ + { \ + if (((H)->dynindx == -1 \ + && !LOCAL_UNDEFWEAK \ + && !(((H)->forced_local || bfd_link_executable (INFO)) \ + && (H)->def_regular \ + && (H)->type == STT_GNU_IFUNC)) \ + || (PLT) == NULL \ + || (GOTPLT) == NULL \ + || (RELPLT) == NULL) \ + abort (); \ + } \ + while (0); /* Verify that the symbol supports copy relocation. */ #define VERIFY_COPY_RELOC(H, HTAB) \ - if ((H)->dynindx == -1 \ - || ((H)->root.type != bfd_link_hash_defined \ - && (H)->root.type != bfd_link_hash_defweak) \ - || (HTAB)->elf.srelbss == NULL \ - || (HTAB)->elf.sreldynrelro == NULL) \ - abort (); + do \ + { \ + if ((H)->dynindx == -1 \ + || ((H)->root.type != bfd_link_hash_defined \ + && (H)->root.type != bfd_link_hash_defweak) \ + || (HTAB)->elf.srelbss == NULL \ + || (HTAB)->elf.sreldynrelro == NULL) \ + abort (); \ + } \ + while (0); /* x86 ELF linker hash entry. */ |