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: [PATCH 04/19] PRU GAS Port


On Mon, Dec 05, 2016 at 10:42:19PM +0200, Dimitar Dimitrov wrote:
> +#ifndef OBJ_ELF
> +/* We are not supporting any other target so we throw a compile time error.  */
> +OBJ_ELF not defined
> +#endif

Use #error

> +static bfd_boolean
> +pru_check_overflow (valueT fixup, reloc_howto_type *howto)
> +{
> +  /* Apply the rightshift before checking for overflow.  */
> +  fixup = ((signed)fixup) >> howto->rightshift;

(signed) is not the correct cast.  Use offsetT instead, which is the
same size as valueT.  valueT might be 64 bit and signed int 32 bit.
Also, the C standard doesn't guarantee that right shifts of signed
values propagate the sign bit but says that is implementation
defined..  Can you use bfd_check_overflow here?

-- 
Alan Modra
Australia Development Lab, IBM


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