This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [commiited, PATCH] x86: Add VERIFY_COPY_RELOC
- From: Pedro Alves <palves at redhat dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>, binutils at sourceware dot org
- Date: Fri, 6 Oct 2017 13:26:00 +0100
- Subject: Re: [commiited, PATCH] x86: Add VERIFY_COPY_RELOC
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=palves at redhat dot com
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com E0A84820E5
- References: <20171006075230.GA18938@gmail.com>
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