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] S12Z: Set eh_addr_size to 4


On Wed, Oct 03, 2018 at 01:55:46PM +0200, John Darrington wrote:
> diff --git a/binutils/objdump.c b/binutils/objdump.c
> index f468fcdb59..d3ab2e4cd1 100644
> --- a/binutils/objdump.c
> +++ b/binutils/objdump.c
> @@ -2711,6 +2711,11 @@ dump_dwarf (bfd *abfd)
>  
>    eh_addr_size = bfd_arch_bits_per_address (abfd) / 8;
>  
> +  /* S12Z has a 24 bit address space.  But the only known
> +     producer of dwarf_info encodes addresses into 32 bits. */
> +  if (bfd_get_arch (abfd) == bfd_arch_s12z)
> +    eh_addr_size = 4;
> +
>    if (bfd_big_endian (abfd))
>      byte_get = byte_get_big_endian;
>    else if (bfd_little_endian (abfd))

I'm committing this variant of your patch.

>From 8ab159a96565be6e60f8d88ba3a4638116f7e9d3 Mon Sep 17 00:00:00 2001
From: Alan Modra <amodra@gmail.com>
Date: Wed, 10 Oct 2018 12:17:54 +1030
Subject: [PATCH 1/4] S12Z: Set eh_addr_size to 4

	* objdump.c (dump_dwarf): Set s12z eh_addr_size to 4.

diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index 6737c6794c..09436ccedc 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,3 +1,7 @@
+2018-10-10  Alan Modra  <amodra@gmail.com>
+
+	* objdump.c (dump_dwarf): Set s12z eh_addr_size to 4.
+
 2018-10-08  Andreas Schwab  <schwab@suse.de>
 
 	* readelf.c (is_32bit_pcrel_reloc): Handle R_RISCV_32_PCREL.
diff --git a/binutils/objdump.c b/binutils/objdump.c
index f468fcdb59..4368fc0666 100644
--- a/binutils/objdump.c
+++ b/binutils/objdump.c
@@ -2759,6 +2759,12 @@ dump_dwarf (bfd *abfd)
       init_dwarf_regnames_riscv ();
       break;
 
+    case bfd_arch_s12z:
+      /* S12Z has a 24 bit address space.  But the only known
+	 producer of dwarf_info encodes addresses into 32 bits.  */
+      eh_addr_size = 4;
+      break;
+
     default:
       break;
     }


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