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] [PowerPC] VLE update


On Sat, Aug 26, 2017 at 08:37:22PM +0300, Alexander Fedotov wrote:
> This patch adds support PLT for VLE ISA. Also adds new relocations and
> section headers handling.

Looks to me like you've been give the job of sweeping out the
stables..

> +  /* PowerPC VLE code.  */
> +#define SEC_PPC_VLE 0x100000000

How can this possibly work?  The field is an unsigned int.

> @@ -7371,10 +7474,21 @@ ppc_elf_relax_section (bfd *abfd,
>  	    case R_PPC_REL24:
>  	    case R_PPC_LOCAL24PC:
>  	    case R_PPC_PLTREL24:
> -	      t0 = bfd_get_32 (abfd, hit_addr);
> -	      t0 &= ~0x3fffffc;
> -	      t0 |= val & 0x3fffffc;
> -	      bfd_put_32 (abfd, t0, hit_addr);
> +	      if (r_type == R_PPC_PLTREL24
> +		  && (elf_section_flags (isec) & SHF_PPC_VLE) != 0)
> +		{
> +		  t0 = bfd_get_32 (abfd, hit_addr);
> +		  t0 &= ~0x01fffffe;
> +		  t0 |= val & 0x01fffffe;
> +		  bfd_put_32 (abfd, t0, hit_addr);
> +		}
> +	      else
> +		{
> +		  t0 = bfd_get_32 (abfd, hit_addr);
> +		  t0 &= ~0x3fffffc;
> +		  t0 |= val & 0x3fffffc;
> +		  bfd_put_32 (abfd, t0, hit_addr);
> +		}

What is going on here?  

> +	(R_PPC_VLE_PLTREL24): New relocation.
> +	(R_PPC_VLE_ADDR20): Likewise.

How are these generated?  I see code that processes them, but nothing
to create them.

> @@ -253,12 +253,13 @@ get_powerpc_dialect (struct disassemble_info *info)
>    dialect = POWERPC_DIALECT (info);
>  
>    /* Disassemble according to the section headers flags for VLE-mode.  */
> -  if (dialect & PPC_OPCODE_VLE
> -      && info->section != NULL && info->section->owner != NULL
> +  if (dialect & PPC_OPCODE_VLE)
> +    return dialect;
> +  else if (info->section != NULL && info->section->owner != NULL
>        && bfd_get_flavour (info->section->owner) == bfd_target_elf_flavour
>        && elf_object_id (info->section->owner) == PPC32_ELF_DATA
>        && (elf_section_flags (info->section) & SHF_PPC_VLE) != 0)
> -    return dialect;
> +    return PPC_OPCODE_VLE;
>    else
>      return dialect & ~ PPC_OPCODE_VLE;

Can you explain why this change is necessary?

-- 
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]