]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - bfd/verilog.c
Update year range in copyright notice of binutils files
[thirdparty/binutils-gdb.git] / bfd / verilog.c
index a785e50a00a4a5f4cfa77c36ed760313f8a0c46c..a54f6b04ebb5863bea24008988a3df304ee8bae6 100644 (file)
@@ -1,5 +1,5 @@
 /* BFD back-end for verilog hex memory dump files.
-   Copyright (C) 2009-2019 Free Software Foundation, Inc.
+   Copyright (C) 2009-2021 Free Software Foundation, Inc.
    Written by Anthony Green <green@moxielogic.com>
 
    This file is part of BFD, the Binary File Descriptor library.
@@ -165,12 +165,25 @@ verilog_set_section_contents (bfd *abfd,
 static bfd_boolean
 verilog_write_address (bfd *abfd, bfd_vma address)
 {
-  char buffer[12];
+  char buffer[20];
   char *dst = buffer;
   bfd_size_type wrlen;
 
   /* Write the address.  */
   *dst++ = '@';
+#ifdef BFD64
+  if (address >= (bfd_vma)1 << 32)
+    {
+      TOHEX (dst, (address >> 56));
+      dst += 2;
+      TOHEX (dst, (address >> 48));
+      dst += 2;
+      TOHEX (dst, (address >> 40));
+      dst += 2;
+      TOHEX (dst, (address >> 32));
+      dst += 2;
+    }
+#endif
   TOHEX (dst, (address >> 24));
   dst += 2;
   TOHEX (dst, (address >> 16));