aboutsummaryrefslogtreecommitdiff
path: root/bfd/verilog.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2020-09-16 16:19:53 +0100
committerNick Clifton <nickc@redhat.com>2020-09-16 16:19:53 +0100
commit7def0865921f4256c8ae0fe1aad61d2e8ae64ca9 (patch)
tree88fb43784aa065dd5f97fc6eb3c97055bfdc7c1d /bfd/verilog.c
parentda1df1db9ae43050c8de62e4842428ddda7eb509 (diff)
downloadbinutils-7def0865921f4256c8ae0fe1aad61d2e8ae64ca9.zip
binutils-7def0865921f4256c8ae0fe1aad61d2e8ae64ca9.tar.gz
binutils-7def0865921f4256c8ae0fe1aad61d2e8ae64ca9.tar.bz2
Oops - failed to commit change to verilog.c. Trying again.
* verilog.c (verilog_write_address): Properly handle 64-bit addresses to avoid truncation of the high part.
Diffstat (limited to 'bfd/verilog.c')
-rw-r--r--bfd/verilog.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/bfd/verilog.c b/bfd/verilog.c
index 9f22bc3..83d4ccc 100644
--- a/bfd/verilog.c
+++ b/bfd/verilog.c
@@ -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));