[commiited, PATCH] x86: Add VERIFY_COPY_RELOC
Pedro Alves
palves@redhat.com
Fri Oct 6 12:26:00 GMT 2017
On 10/06/2017 08:52 AM, H.J. Lu wrote:
>
> +/* 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 ();
> +
I'd suggest at least wrapping macros such as this
one with do/while(0) to avoid potential dangling
else problems.
Thanks,
Pedro Alves
More information about the Binutils
mailing list