This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [commiited, PATCH] x86: Add VERIFY_COPY_RELOC


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]