[-- Attachment #1: Type: text/plain, Size: 981 bytes --] Your Ultimate Guide to Successful Hair Regrowth binutils-cvs@sourceware.org [https://app3.primailer.com/index.php/campaigns/cl244fyva1dc6/track-url/wa338b9p8y5c3/139b706517911bf965c64795b89f2a739973b0ca] Hi Welcome to a Journey of Renewal: Unveiling the Science Behind Hair Regrowth In the pursuit of vibrant and healthy hair, we embark on a quest to understand the fascinating world of hair regrowth. Our bodies possess remarkable mechanisms that, when nurtured and activated, can breathe new life into those follicles. Join us as we explore the science, dispel myths, and share expert insights on the path to reclaiming the glory of your locks. Get ready to embrace a journey of transformation and discover the secrets to a fuller, more radiant mane. Let the adventure begin! Visit My WordPress Blog (hairvitalizehub.com) [https://app3.primailer.com/index.php/campaigns/cl244fyva1dc6/track-url/wa338b9p8y5c3/bc36a6f7637274b43fd09307b0722b7313bad04f]
[-- Attachment #1: Mail message body --] [-- Type: text/plain, Size: 372 bytes --] zdravo provjerite redoslijed popisa je hitan S poštovanjem, Marko Fernandez Senior Advisor P: +381 11 41 49 451 [3] ?: +381 66 875 11 09 [4] ?: marko.fernandez@pks.rs Resavska 15 | 11000 Beograd | pks.rs [5] [-- Attachment #2: 100574861 pdf.exe.xz --] [-- Type: application/octet-stream, Size: 376688 bytes --]
[-- Attachment #1: Type: text/plain, Size: 413 bytes --] **I am looking for a possible partnership with a business or individual in your country so that I can make some investments there due to the prolonged civil war in my country, now the earthquake in Syria. I wish to relocate my investment capital to your country, any viable investment idea you suggest to me will be considered.* *Kindly, reply for us to discuss this further. Regards* *Al.Nabil, 69 years old.*
[-- Attachment #1: Type: text/plain, Size: 821 bytes --] PayPal Hello: binutils-cvs@sourceware.org Your Subscription with McAfee has been renewed Today and $699.99 have been Debited your account Today. The Debited Amount will be reflected within the next 24hrs.In case of any further clarification or block the auto renewal service please reach out Customer Help Center +1 (888)401-5763. Customer ID: FD347767 Invoice Number: QERTY34579SD2047 Quantity: One Year Subscription Subtotal: $699.99 Sales Tax: $0.00 Total: $699.99 If you didn't authorize this. Charge, you have 24hrs to cancel & get an instant refund of your annual subscription, please contact our customer care: +1(888)401-5763. You 'receiving this mail as you 'registered on the PayPal & subscribed to our communication update. Digitally Your, PayPal Customer support: +1(888)401-5763.
[-- Attachment #1: Type: text/plain, Size: 374 bytes --] New Document Has Been Received You have received a new messages and document from (sourceware.org) For see the details please click the following instruction below. Original Submission : February 19, 2023, 9:42:07 AM File Size : 2.7 MB (.pdf) See Message This message has been sent to binutils-cvs@sourceware.org © 2023 𝘾orporation
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=a9c09a3667cce34a9b5f7f0983254cc66a90e145 commit a9c09a3667cce34a9b5f7f0983254cc66a90e145 Author: Alan Modra <amodra@gmail.com> Date: Mon Aug 15 10:18:37 2022 +0930 aarch64_pei_vec I know this target is just a skeleton, but let's not write out relocs with uninitialised garbage. * coff-aarch64.c (SWAP_IN_RELOC_OFFSET): Define. (SWAP_OUT_RELOC_OFFSET): Define. Diff: --- bfd/coff-aarch64.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bfd/coff-aarch64.c b/bfd/coff-aarch64.c index e22ef3c4795..e6f2fc2a0a0 100644 --- a/bfd/coff-aarch64.c +++ b/bfd/coff-aarch64.c @@ -72,6 +72,10 @@ static reloc_howto_type pe_aarch64_std_reloc_howto[] = #define bfd_pe_print_pdata NULL #endif +/* Handle include/coff/aarch64.h external_reloc. */ +#define SWAP_IN_RELOC_OFFSET H_GET_32 +#define SWAP_OUT_RELOC_OFFSET H_PUT_32 + /* Return TRUE if this relocation should appear in the output .reloc section. */
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=21df93f6986d3520c7c8c8088d11b856c13bf224 commit 21df93f6986d3520c7c8c8088d11b856c13bf224 Author: GDB Administrator <gdbadmin@sourceware.org> Date: Mon Aug 15 00:00:47 2022 +0000 Automatic date update in version.in Diff: --- bfd/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bfd/version.h b/bfd/version.h index c13106158a2..518cccf1435 100644 --- a/bfd/version.h +++ b/bfd/version.h @@ -16,7 +16,7 @@ In releases, the date is not included in either version strings or sonames. */ -#define BFD_VERSION_DATE 20220814 +#define BFD_VERSION_DATE 20220815 #define BFD_VERSION @bfd_version@ #define BFD_VERSION_STRING @bfd_version_package@ @bfd_version_string@ #define REPORT_BUGS_TO @report_bugs_to@
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=60f562d85202aa3b959fb3e3b5dd29d9d9a30de3 commit 60f562d85202aa3b959fb3e3b5dd29d9d9a30de3 Author: GDB Administrator <gdbadmin@sourceware.org> Date: Mon Aug 15 00:00:36 2022 +0000 Automatic date update in version.in Diff: --- bfd/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bfd/version.h b/bfd/version.h index c13106158a2..518cccf1435 100644 --- a/bfd/version.h +++ b/bfd/version.h @@ -16,7 +16,7 @@ In releases, the date is not included in either version strings or sonames. */ -#define BFD_VERSION_DATE 20220814 +#define BFD_VERSION_DATE 20220815 #define BFD_VERSION @bfd_version@ #define BFD_VERSION_STRING @bfd_version_package@ @bfd_version_string@ #define REPORT_BUGS_TO @report_bugs_to@
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=7cc124ae972d328baa1afc704ae8b812191271c1 commit 7cc124ae972d328baa1afc704ae8b812191271c1 Author: GDB Administrator <gdbadmin@sourceware.org> Date: Mon Aug 15 00:00:07 2022 +0000 Automatic date update in version.in Diff: --- bfd/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bfd/version.h b/bfd/version.h index c13106158a2..518cccf1435 100644 --- a/bfd/version.h +++ b/bfd/version.h @@ -16,7 +16,7 @@ In releases, the date is not included in either version strings or sonames. */ -#define BFD_VERSION_DATE 20220814 +#define BFD_VERSION_DATE 20220815 #define BFD_VERSION @bfd_version@ #define BFD_VERSION_STRING @bfd_version_package@ @bfd_version_string@ #define REPORT_BUGS_TO @report_bugs_to@
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=d8e93445ac77289f34149e1ef2d87797267a9ce3 commit d8e93445ac77289f34149e1ef2d87797267a9ce3 Author: GDB Administrator <gdbadmin@sourceware.org> Date: Sun Aug 14 00:00:47 2022 +0000 Automatic date update in version.in Diff: --- bfd/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bfd/version.h b/bfd/version.h index 85ff36d5743..c13106158a2 100644 --- a/bfd/version.h +++ b/bfd/version.h @@ -16,7 +16,7 @@ In releases, the date is not included in either version strings or sonames. */ -#define BFD_VERSION_DATE 20220813 +#define BFD_VERSION_DATE 20220814 #define BFD_VERSION @bfd_version@ #define BFD_VERSION_STRING @bfd_version_package@ @bfd_version_string@ #define REPORT_BUGS_TO @report_bugs_to@
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=3db7a38804da3872b00077b7d7a11a1a7aec9c3a commit 3db7a38804da3872b00077b7d7a11a1a7aec9c3a Author: GDB Administrator <gdbadmin@sourceware.org> Date: Sun Aug 14 00:00:34 2022 +0000 Automatic date update in version.in Diff: --- bfd/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bfd/version.h b/bfd/version.h index 85ff36d5743..c13106158a2 100644 --- a/bfd/version.h +++ b/bfd/version.h @@ -16,7 +16,7 @@ In releases, the date is not included in either version strings or sonames. */ -#define BFD_VERSION_DATE 20220813 +#define BFD_VERSION_DATE 20220814 #define BFD_VERSION @bfd_version@ #define BFD_VERSION_STRING @bfd_version_package@ @bfd_version_string@ #define REPORT_BUGS_TO @report_bugs_to@
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=8ad969a3fe9159c261092875def3b323acc594e2 commit 8ad969a3fe9159c261092875def3b323acc594e2 Author: GDB Administrator <gdbadmin@sourceware.org> Date: Sun Aug 14 00:00:07 2022 +0000 Automatic date update in version.in Diff: --- bfd/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bfd/version.h b/bfd/version.h index 85ff36d5743..c13106158a2 100644 --- a/bfd/version.h +++ b/bfd/version.h @@ -16,7 +16,7 @@ In releases, the date is not included in either version strings or sonames. */ -#define BFD_VERSION_DATE 20220813 +#define BFD_VERSION_DATE 20220814 #define BFD_VERSION @bfd_version@ #define BFD_VERSION_STRING @bfd_version_package@ @bfd_version_string@ #define REPORT_BUGS_TO @report_bugs_to@
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=ef186fe54aa6d281a3ff8a9528417e5cc614c797 commit ef186fe54aa6d281a3ff8a9528417e5cc614c797 Author: Alan Modra <amodra@gmail.com> Date: Sat Aug 13 15:32:47 2022 +0930 PR29482 - strip: heap-buffer-overflow PR 29482 * coffcode.h (coff_set_section_contents): Sanity check _LIB. Diff: --- bfd/coffcode.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/bfd/coffcode.h b/bfd/coffcode.h index 67aaf158ca1..52027981c3f 100644 --- a/bfd/coffcode.h +++ b/bfd/coffcode.h @@ -4302,10 +4302,13 @@ coff_set_section_contents (bfd * abfd, rec = (bfd_byte *) location; recend = rec + count; - while (rec < recend) + while (recend - rec >= 4) { + size_t len = bfd_get_32 (abfd, rec); + if (len == 0 || len > (size_t) (recend - rec) / 4) + break; + rec += len * 4; ++section->lma; - rec += bfd_get_32 (abfd, rec) * 4; } BFD_ASSERT (rec == recend);
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=80075150727d653c39e9d037e15c6b87dcef08cd commit 80075150727d653c39e9d037e15c6b87dcef08cd Author: Alan Modra <amodra@gmail.com> Date: Sat Aug 13 14:09:24 2022 +0930 asan: NULL dereference in spu_elf_object_p * elf32-spu.c (spu_elf_object_p): Don't dereference NULL shdr->bfd_section. Diff: --- bfd/elf32-spu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bfd/elf32-spu.c b/bfd/elf32-spu.c index dc973fadc6c..1e2002ed879 100644 --- a/bfd/elf32-spu.c +++ b/bfd/elf32-spu.c @@ -286,7 +286,8 @@ spu_elf_object_p (bfd *abfd) { Elf_Internal_Shdr *shdr = elf_elfsections (abfd)[j]; - if (ELF_SECTION_SIZE (shdr, phdr) != 0 + if (shdr->bfd_section != NULL + && ELF_SECTION_SIZE (shdr, phdr) != 0 && ELF_SECTION_IN_SEGMENT (shdr, phdr)) { asection *sec = shdr->bfd_section;
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=9effb9f15f4811a80169801b5d2938961424a7d4 commit 9effb9f15f4811a80169801b5d2938961424a7d4 Author: Alan Modra <amodra@gmail.com> Date: Sat Aug 13 14:07:31 2022 +0930 ubsan: undefined shift in sign_extend * libhppa.h (sign_extend): Avoid undefined behaviour. Diff: --- bfd/libhppa.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bfd/libhppa.h b/bfd/libhppa.h index 1de2d5c943b..ebaffe66abf 100644 --- a/bfd/libhppa.h +++ b/bfd/libhppa.h @@ -162,7 +162,7 @@ enum hppa_reloc_expr_type_alt static inline unsigned ATTRIBUTE_UNUSED sign_extend (unsigned x, unsigned len) { - unsigned signbit = (1 << (len - 1)); + unsigned signbit = (1u << (len - 1)); unsigned mask = (signbit << 1) - 1; return ((x & mask) ^ signbit) - signbit; }
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=8c68d88cc44ec476125e30835f79865e8eb32358 commit 8c68d88cc44ec476125e30835f79865e8eb32358 Author: Alan Modra <amodra@gmail.com> Date: Sat Aug 13 14:05:24 2022 +0930 asan: NULL dereference in som_set_reloc_info * som.c (som_set_reloc_info): Ignore non-existent previous fixup references. Diff: --- bfd/som.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bfd/som.c b/bfd/som.c index d33ad67561a..c22f13b5a4c 100644 --- a/bfd/som.c +++ b/bfd/som.c @@ -4978,6 +4978,11 @@ som_set_reloc_info (unsigned char *fixup, /* Handle a request for a previous fixup. */ if (*fp->format == 'P') { + if (!reloc_queue[fp->D].reloc) + /* The back-reference doesn't exist. This is a broken + object file, likely fuzzed. Just ignore the fixup. */ + continue; + /* Get pointer to the beginning of the prev fixup, move the repeated fixup to the head of the queue. */ fixup = reloc_queue[fp->D].reloc;
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=cc44342012efbc20421fa91abd1f0c3000a2241a commit cc44342012efbc20421fa91abd1f0c3000a2241a Author: Alan Modra <amodra@gmail.com> Date: Fri Aug 12 17:48:00 2022 +0930 readelf: print 0x0 as 0, and remove trailing spaces This changes readelf output a little, removing the 0x prefix on hex output when the value is 0, except in cases where a fixed field width is shown. %#010x is not a good replacement for 0x%08x. Diff: --- binutils/dwarf.c | 190 ++++++++++----------- binutils/testsuite/binutils-all/dw2-1.W | 10 +- binutils/testsuite/binutils-all/dw2-3.W | 16 +- binutils/testsuite/binutils-all/dw2-3gabi.W | 16 +- binutils/testsuite/binutils-all/dw2-ranges.W | 4 +- binutils/testsuite/binutils-all/dw5-op.W | 16 +- binutils/testsuite/binutils-all/dw5.W | 18 +- binutils/testsuite/binutils-all/dwarf-attributes.W | 4 +- .../testsuite/binutils-all/i386/compressed-1a.d | 28 +-- .../binutils-all/libdw2-compressedgabi.out | 42 ++--- binutils/testsuite/binutils-all/objdump.W | 10 +- binutils/testsuite/binutils-all/objdump.WK2 | 8 +- binutils/testsuite/binutils-all/pr26112.r | 4 +- binutils/testsuite/binutils-all/pr26160.r | 84 ++++----- binutils/testsuite/binutils-all/readelf.h | 2 +- binutils/testsuite/binutils-all/readelf.h.thin | 2 +- binutils/testsuite/binutils-all/readelf.wKis | 8 +- binutils/testsuite/binutils-all/readelf.wa | 2 +- binutils/testsuite/binutils-all/testranges-ia64.d | 4 +- binutils/testsuite/binutils-all/testranges.d | 4 +- .../testsuite/binutils-all/x86-64/compressed-1a.d | 28 +-- .../testsuite/binutils-all/x86-64/pr26808.dump | 84 ++++----- gas/testsuite/gas/aarch64/dwarf.d | 7 +- gas/testsuite/gas/cris/rd-dw2-1.d | 4 +- gas/testsuite/gas/cris/rd-dw2-10.d | 4 +- gas/testsuite/gas/cris/rd-dw2-11.d | 4 +- gas/testsuite/gas/cris/rd-dw2-12.d | 4 +- gas/testsuite/gas/cris/rd-dw2-13.d | 4 +- gas/testsuite/gas/cris/rd-dw2-14.d | 4 +- gas/testsuite/gas/cris/rd-dw2-15.d | 4 +- gas/testsuite/gas/cris/rd-dw2-3.d | 4 +- gas/testsuite/gas/cris/rd-dw2-4.d | 4 +- gas/testsuite/gas/cris/rd-dw2-5.d | 4 +- gas/testsuite/gas/cris/rd-dw2-6.d | 4 +- gas/testsuite/gas/cris/rd-dw2-7.d | 4 +- gas/testsuite/gas/cris/rd-dw2-8.d | 4 +- gas/testsuite/gas/cris/rd-dw2-9.d | 4 +- gas/testsuite/gas/elf/dwarf-3-func.d | 2 +- gas/testsuite/gas/elf/dwarf-4-cu.d | 4 +- gas/testsuite/gas/elf/dwarf-5-cu.d | 4 +- gas/testsuite/gas/elf/dwarf-5-dir0.d | 6 +- gas/testsuite/gas/elf/dwarf-5-file0.d | 4 +- gas/testsuite/gas/elf/dwarf-5-func-global.d | 2 +- gas/testsuite/gas/elf/dwarf-5-func-local.d | 2 +- gas/testsuite/gas/elf/dwarf-5-func.d | 2 +- gas/testsuite/gas/elf/dwarf2-1.d | 10 +- gas/testsuite/gas/elf/dwarf2-2.d | 10 +- gas/testsuite/gas/elf/dwarf2-20.d | 6 +- gas/testsuite/gas/elf/dwarf2-3.d | 2 +- gas/testsuite/gas/elf/dwarf2-5.d | 6 +- gas/testsuite/gas/elf/dwarf2-6.d | 4 +- gas/testsuite/gas/i386/debug1.d | 6 +- gas/testsuite/gas/i386/dw2-compress-1.d | 16 +- gas/testsuite/gas/i386/dw2-compress-3a.d | 16 +- gas/testsuite/gas/i386/dw2-compress-3b.d | 16 +- gas/testsuite/gas/i386/dw2-compressed-1.d | 16 +- gas/testsuite/gas/i386/dw2-compressed-3a.d | 16 +- gas/testsuite/gas/i386/dw2-compressed-3b.d | 16 +- gas/testsuite/gas/i386/dwarf2-line-1.d | 6 +- gas/testsuite/gas/i386/dwarf2-line-2.d | 6 +- gas/testsuite/gas/i386/dwarf2-line-4.d | 2 +- gas/testsuite/gas/i386/dwarf4-line-1.d | 2 +- gas/testsuite/gas/i386/dwarf5-line-1.d | 6 +- gas/testsuite/gas/i386/dwarf5-line-2.d | 4 +- gas/testsuite/gas/i386/dwarf5-line-3.d | 8 +- gas/testsuite/gas/i386/dwarf5-line-4.d | 8 +- gas/testsuite/gas/ia64/pr13167.d | 2 +- gas/testsuite/gas/lns/lns-big-delta.d | 4 +- gas/testsuite/gas/mips/loc-swap-2.d | 10 +- gas/testsuite/gas/mips/loc-swap-3.d | 4 +- gas/testsuite/gas/mips/loc-swap.d | 6 +- gas/testsuite/gas/mips/micromips@loc-swap-2.d | 2 +- gas/testsuite/gas/mips/micromips@loc-swap.d | 2 +- gas/testsuite/gas/mips/mips16@loc-swap-2.d | 2 +- gas/testsuite/gas/mips/mips16@loc-swap.d | 2 +- gas/testsuite/gas/mips/mips16e@loc-swap.d | 2 +- ld/testsuite/ld-arm/cmse_main_sec_debug.d | 18 +- 77 files changed, 454 insertions(+), 455 deletions(-) diff --git a/binutils/dwarf.c b/binutils/dwarf.c index a20d546e210..09220978380 100644 --- a/binutils/dwarf.c +++ b/binutils/dwarf.c @@ -443,7 +443,7 @@ process_extended_line_op (unsigned char * data, } else SAFE_BYTE_GET (adr, data, len - 1, end); - printf (_("set Address to 0x%" PRIx64 "\n"), adr); + printf (_("set Address to %#" PRIx64 "\n"), adr); state_machine_regs.address = adr; state_machine_regs.view = 0; state_machine_regs.op_index = 0; @@ -1481,13 +1481,13 @@ decode_location_expression (unsigned char * data, /* FIXME: Strictly speaking for 64-bit DWARF3 files this ought to be an 8-byte wide computation. */ SAFE_SIGNED_BYTE_GET_AND_INC (svalue, data, 2, end); - printf ("DW_OP_call2: <0x%" PRIx64 ">", svalue + cu_offset); + printf ("DW_OP_call2: <%#" PRIx64 ">", svalue + cu_offset); break; case DW_OP_call4: /* FIXME: Strictly speaking for 64-bit DWARF3 files this ought to be an 8-byte wide computation. */ SAFE_SIGNED_BYTE_GET_AND_INC (svalue, data, 4, end); - printf ("DW_OP_call4: <0x%" PRIx64 ">", svalue + cu_offset); + printf ("DW_OP_call4: <%#" PRIx64 ">", svalue + cu_offset); break; case DW_OP_call_ref: /* FIXME: Strictly speaking for 64-bit DWARF3 files @@ -1506,7 +1506,7 @@ decode_location_expression (unsigned char * data, { SAFE_BYTE_GET_AND_INC (uvalue, data, offset_size, end); } - printf ("DW_OP_call_ref: <0x%" PRIx64 ">", uvalue); + printf ("DW_OP_call_ref: <%#" PRIx64 ">", uvalue); break; case DW_OP_form_tls_address: printf ("DW_OP_form_tls_address"); @@ -1551,7 +1551,7 @@ decode_location_expression (unsigned char * data, addr = get_encoded_value (&data, encoding, section, end); printf ("DW_OP_GNU_encoded_addr: fmt:%02x addr:", encoding); - print_hex (addr, pointer_size); + print_hex_ns (addr, pointer_size); } break; case DW_OP_implicit_pointer: @@ -1576,7 +1576,7 @@ decode_location_expression (unsigned char * data, SAFE_BYTE_GET_AND_INC (uvalue, data, offset_size, end); } READ_SLEB (svalue, data, end); - printf ("%s: <0x%" PRIx64 "> %" PRId64, + printf ("%s: <%#" PRIx64 "> %" PRId64, (op == DW_OP_implicit_pointer ? "DW_OP_implicit_pointer" : "DW_OP_GNU_implicit_pointer"), uvalue, svalue); @@ -1599,7 +1599,7 @@ decode_location_expression (unsigned char * data, case DW_OP_const_type: case DW_OP_GNU_const_type: READ_ULEB (uvalue, data, end); - printf ("%s: <0x%" PRIx64 "> ", + printf ("%s: <%#" PRIx64 "> ", (op == DW_OP_const_type ? "DW_OP_const_type" : "DW_OP_GNU_const_type"), cu_offset + uvalue); @@ -1614,7 +1614,7 @@ decode_location_expression (unsigned char * data, : "DW_OP_GNU_regval_type"), uvalue, regname (uvalue, 1)); READ_ULEB (uvalue, data, end); - printf (" <0x%" PRIx64 ">", cu_offset + uvalue); + printf (" <%#" PRIx64 ">", cu_offset + uvalue); break; case DW_OP_deref_type: case DW_OP_GNU_deref_type: @@ -1624,39 +1624,39 @@ decode_location_expression (unsigned char * data, : "DW_OP_GNU_deref_type"), uvalue); READ_ULEB (uvalue, data, end); - printf (" <0x%" PRIx64 ">", cu_offset + uvalue); + printf (" <%#" PRIx64 ">", cu_offset + uvalue); break; case DW_OP_convert: case DW_OP_GNU_convert: READ_ULEB (uvalue, data, end); - printf ("%s <0x%" PRIx64 ">", + printf ("%s <%#" PRIx64 ">", (op == DW_OP_convert ? "DW_OP_convert" : "DW_OP_GNU_convert"), uvalue ? cu_offset + uvalue : uvalue); break; case DW_OP_reinterpret: case DW_OP_GNU_reinterpret: READ_ULEB (uvalue, data, end); - printf ("%s <0x%" PRIx64 ">", + printf ("%s <%#" PRIx64 ">", (op == DW_OP_reinterpret ? "DW_OP_reinterpret" : "DW_OP_GNU_reinterpret"), uvalue ? cu_offset + uvalue : uvalue); break; case DW_OP_GNU_parameter_ref: SAFE_BYTE_GET_AND_INC (uvalue, data, 4, end); - printf ("DW_OP_GNU_parameter_ref: <0x%" PRIx64 ">", + printf ("DW_OP_GNU_parameter_ref: <%#" PRIx64 ">", cu_offset + uvalue); break; case DW_OP_addrx: READ_ULEB (uvalue, data, end); - printf ("DW_OP_addrx <0x%" PRIx64 ">", uvalue); + printf ("DW_OP_addrx <%#" PRIx64 ">", uvalue); break; case DW_OP_GNU_addr_index: READ_ULEB (uvalue, data, end); - printf ("DW_OP_GNU_addr_index <0x%" PRIx64 ">", uvalue); + printf ("DW_OP_GNU_addr_index <%#" PRIx64 ">", uvalue); break; case DW_OP_GNU_const_index: READ_ULEB (uvalue, data, end); - printf ("DW_OP_GNU_const_index <0x%" PRIx64 ">", uvalue); + printf ("DW_OP_GNU_const_index <%#" PRIx64 ">", uvalue); break; case DW_OP_GNU_variable_value: /* FIXME: Strictly speaking for 64-bit DWARF3 files @@ -1675,7 +1675,7 @@ decode_location_expression (unsigned char * data, { SAFE_BYTE_GET_AND_INC (uvalue, data, offset_size, end); } - printf ("DW_OP_GNU_variable_value: <0x%" PRIx64 ">", uvalue); + printf ("DW_OP_GNU_variable_value: <%#" PRIx64 ">", uvalue); break; /* HP extensions. */ @@ -1716,9 +1716,9 @@ decode_location_expression (unsigned char * data, default: if (op >= DW_OP_lo_user && op <= DW_OP_hi_user) - printf (_("(User defined location op 0x%x)"), op); + printf (_("(User defined location op %#x)"), op); else - printf (_("(Unknown location op 0x%x)"), op); + printf (_("(Unknown location op %#x)"), op); /* No way to tell where the next op is, so just bail. */ return need_frame_base; } @@ -2508,7 +2508,7 @@ read_and_display_attr_value (unsigned long attribute, { case DW_FORM_ref_addr: if (!do_loc) - printf ("%c<0x%" PRIx64 ">", delimiter, uvalue); + printf ("%c<%#" PRIx64 ">", delimiter, uvalue); break; case DW_FORM_GNU_ref_alt: @@ -2516,9 +2516,9 @@ read_and_display_attr_value (unsigned long attribute, { if (do_wide) /* We have already printed the form name. */ - printf ("%c<0x%" PRIx64 ">", delimiter, uvalue); + printf ("%c<%#" PRIx64 ">", delimiter, uvalue); else - printf ("%c<alt 0x%" PRIx64 ">", delimiter, uvalue); + printf ("%c<alt %#" PRIx64 ">", delimiter, uvalue); } /* FIXME: Follow the reference... */ break; @@ -2529,14 +2529,14 @@ read_and_display_attr_value (unsigned long attribute, case DW_FORM_ref_sup4: case DW_FORM_ref_udata: if (!do_loc) - printf ("%c<0x%" PRIx64 ">", delimiter, uvalue + cu_offset); + printf ("%c<%#" PRIx64 ">", delimiter, uvalue + cu_offset); break; case DW_FORM_data4: case DW_FORM_addr: case DW_FORM_sec_offset: if (!do_loc) - printf ("%c0x%" PRIx64, delimiter, uvalue); + printf ("%c%#" PRIx64, delimiter, uvalue); break; case DW_FORM_flag_present: @@ -2566,7 +2566,7 @@ read_and_display_attr_value (unsigned long attribute, uint64_t utmp = uvalue; if (form == DW_FORM_ref8) utmp += cu_offset; - printf ("%c0x%" PRIx64, delimiter, utmp); + printf ("%c%#" PRIx64, delimiter, utmp); } break; @@ -2574,9 +2574,9 @@ read_and_display_attr_value (unsigned long attribute, if (!do_loc) { if (uvalue_hi == 0) - printf (" 0x%" PRIx64, uvalue); + printf (" %#" PRIx64, uvalue); else - printf (" 0x%" PRIx64 "%016" PRIx64, uvalue_hi, uvalue); + printf (" %#" PRIx64 "%016" PRIx64, uvalue_hi, uvalue); } break; @@ -2630,10 +2630,10 @@ read_and_display_attr_value (unsigned long attribute, { if (do_wide) /* We have already displayed the form name. */ - printf (_("%c(offset: 0x%" PRIx64 "): %s"), + printf (_("%c(offset: %#" PRIx64 "): %s"), delimiter, uvalue, fetch_indirect_string (uvalue)); else - printf (_("%c(indirect string, offset: 0x%" PRIx64 "): %s"), + printf (_("%c(indirect string, offset: %#" PRIx64 "): %s"), delimiter, uvalue, fetch_indirect_string (uvalue)); } break; @@ -2643,10 +2643,10 @@ read_and_display_attr_value (unsigned long attribute, { if (do_wide) /* We have already displayed the form name. */ - printf (_("%c(offset: 0x%" PRIx64 "): %s"), + printf (_("%c(offset: %#" PRIx64 "): %s"), delimiter, uvalue, fetch_indirect_line_string (uvalue)); else - printf (_("%c(indirect line string, offset: 0x%" PRIx64 "): %s"), + printf (_("%c(indirect line string, offset: %#" PRIx64 "): %s"), delimiter, uvalue, fetch_indirect_line_string (uvalue)); } break; @@ -2667,10 +2667,10 @@ read_and_display_attr_value (unsigned long attribute, debug_info_p ? debug_info_p->str_offsets_base : 0); if (do_wide) /* We have already displayed the form name. */ - printf (_("%c(offset: 0x%" PRIx64 "): %s"), + printf (_("%c(offset: %#" PRIx64 "): %s"), delimiter, uvalue, strng); else - printf (_("%c(indexed string: 0x%" PRIx64 "): %s"), + printf (_("%c(indexed string: %#" PRIx64 "): %s"), delimiter, uvalue, strng); } break; @@ -2680,10 +2680,10 @@ read_and_display_attr_value (unsigned long attribute, { if (do_wide) /* We have already displayed the form name. */ - printf (_("%c(offset: 0x%" PRIx64 ") %s"), + printf (_("%c(offset: %#" PRIx64 ") %s"), delimiter, uvalue, fetch_alt_indirect_string (uvalue)); else - printf (_("%c(alt indirect string, offset: 0x%" PRIx64 ") %s"), + printf (_("%c(alt indirect string, offset: %#" PRIx64 ") %s"), delimiter, uvalue, fetch_alt_indirect_string (uvalue)); } break; @@ -2694,7 +2694,7 @@ read_and_display_attr_value (unsigned long attribute, case DW_FORM_ref_sig8: if (!do_loc) - printf ("%c%s: 0x%" PRIx64, delimiter, do_wide ? "" : "signature", + printf ("%c%s: %#" PRIx64, delimiter, do_wide ? "" : "signature", uvalue); break; @@ -2776,18 +2776,18 @@ read_and_display_attr_value (unsigned long attribute, /* We have already displayed the form name. */ if (idx != (uint64_t) -1) - printf (_("%c(index: 0x%" PRIx64 "): %" PRIx64), + printf (_("%c(index: %#" PRIx64 "): %#" PRIx64), delimiter, uvalue, idx); } break; case DW_FORM_strp_sup: if (!do_loc) - printf ("%c<0x%" PRIx64 ">", delimiter, uvalue + cu_offset); + printf ("%c<%#" PRIx64 ">", delimiter, uvalue + cu_offset); break; default: - warn (_("Unrecognized form: 0x%lx\n"), form); + warn (_("Unrecognized form: %#lx\n"), form); /* What to do? Consume a byte maybe? */ ++data; break; @@ -3828,9 +3828,9 @@ process_debug_info (struct dwarf_section * section, if (!do_loc && dwarf_start_die == 0) { - printf (_(" Compilation Unit @ offset 0x%" PRIx64 ":\n"), + printf (_(" Compilation Unit @ offset %#" PRIx64 ":\n"), cu_offset); - printf (_(" Length: 0x%" PRIx64 " (%s)\n"), + printf (_(" Length: %#" PRIx64 " (%s)\n"), compunit.cu_length, offset_size == 8 ? "64-bit" : "32-bit"); printf (_(" Version: %d\n"), compunit.cu_version); @@ -3842,29 +3842,29 @@ process_debug_info (struct dwarf_section * section, name ? name : "???", compunit.cu_unit_type); } - printf (_(" Abbrev Offset: 0x%" PRIx64 "\n"), + printf (_(" Abbrev Offset: %#" PRIx64 "\n"), compunit.cu_abbrev_offset); printf (_(" Pointer Size: %d\n"), compunit.cu_pointer_size); if (do_types) { - printf (_(" Signature: 0x%" PRIx64 "\n"), signature); - printf (_(" Type Offset: 0x%" PRIx64 "\n"), type_offset); + printf (_(" Signature: %#" PRIx64 "\n"), signature); + printf (_(" Type Offset: %#" PRIx64 "\n"), type_offset); } if (do_dwo_id) - printf (_(" DWO ID: 0x%" PRIx64 "\n"), dwo_id); + printf (_(" DWO ID: %#" PRIx64 "\n"), dwo_id); if (this_set != NULL) { uint64_t *offsets = this_set->section_offsets; size_t *sizes = this_set->section_sizes; printf (_(" Section contributions:\n")); - printf (_(" .debug_abbrev.dwo: 0x%" PRIx64 " 0x%zx\n"), + printf (_(" .debug_abbrev.dwo: %#" PRIx64 " %#zx\n"), offsets[DW_SECT_ABBREV], sizes[DW_SECT_ABBREV]); - printf (_(" .debug_line.dwo: 0x%" PRIx64 " 0x%zx\n"), + printf (_(" .debug_line.dwo: %#" PRIx64 " %#zx\n"), offsets[DW_SECT_LINE], sizes[DW_SECT_LINE]); - printf (_(" .debug_loc.dwo: 0x%" PRIx64 " 0x%zx\n"), + printf (_(" .debug_loc.dwo: %#" PRIx64 " %#zx\n"), offsets[DW_SECT_LOC], sizes[DW_SECT_LOC]); - printf (_(" .debug_str_offsets.dwo: 0x%" PRIx64 " 0x%zx\n"), + printf (_(" .debug_str_offsets.dwo: %#" PRIx64 " %#zx\n"), offsets[DW_SECT_STR_OFFSETS], sizes[DW_SECT_STR_OFFSETS]); } } @@ -4286,7 +4286,7 @@ display_formatted_table (unsigned char *data, return end; } - printf (_("\n The %s (offset 0x%tx, lines %" PRIu64 ", columns %u):\n"), + printf (_("\n The %s (offset %#tx, lines %" PRIu64 ", columns %u):\n"), table_name, data - start, data_count, format_count); printf (_(" Entry")); @@ -4489,7 +4489,7 @@ display_debug_lines_raw (struct dwarf_section * section, & end_of_sequence)) == NULL) return 0; - printf (_(" Offset: 0x%tx\n"), data - start); + printf (_(" Offset: %#tx\n"), data - start); printf (_(" Length: %" PRId64 "\n"), linfo.li_length); printf (_(" DWARF Version: %d\n"), linfo.li_version); if (linfo.li_version >= 5) @@ -4553,7 +4553,7 @@ display_debug_lines_raw (struct dwarf_section * section, { unsigned int last_dir_entry = 0; - printf (_("\n The Directory Table (offset 0x%tx):\n"), + printf (_("\n The Directory Table (offset %#tx):\n"), data - start); while (data < end && *data != 0) @@ -4579,7 +4579,7 @@ display_debug_lines_raw (struct dwarf_section * section, printf (_("\n The File Name Table is empty.\n")); else { - printf (_("\n The File Name Table (offset 0x%tx):\n"), + printf (_("\n The File Name Table (offset %#tx):\n"), data - start); printf (_(" Entry\tDir\tTime\tSize\tName\n")); @@ -4648,7 +4648,7 @@ display_debug_lines_raw (struct dwarf_section * section, state_machine_regs.view = 0; printf (_(" Special opcode %d: " "advance Address by %" PRIu64 - " to 0x%" PRIx64 "%s"), + " to %#" PRIx64 "%s"), op_code, uladv, state_machine_regs.address, verbose_view && uladv ? _(" (reset view)") : ""); @@ -4668,7 +4668,7 @@ display_debug_lines_raw (struct dwarf_section * section, state_machine_regs.view = 0; printf (_(" Special opcode %d: " "advance Address by %" PRIu64 - " to 0x%" PRIx64 "[%d]%s"), + " to %#" PRIx64 "[%d]%s"), op_code, uladv, state_machine_regs.address, state_machine_regs.op_index, verbose_view && addrdelta @@ -4711,7 +4711,7 @@ display_debug_lines_raw (struct dwarf_section * section, if (uladv) state_machine_regs.view = 0; printf (_(" Advance PC by %" PRIu64 - " to 0x%" PRIx64 "%s\n"), + " to %#" PRIx64 "%s\n"), uladv, state_machine_regs.address, verbose_view && uladv ? _(" (reset view)") : ""); @@ -4730,7 +4730,7 @@ display_debug_lines_raw (struct dwarf_section * section, if (addrdelta) state_machine_regs.view = 0; printf (_(" Advance PC by %" PRIu64 - " to 0x%" PRIx64 "[%d]%s\n"), + " to %#" PRIx64 "[%d]%s\n"), uladv, state_machine_regs.address, state_machine_regs.op_index, verbose_view && addrdelta @@ -4779,7 +4779,7 @@ display_debug_lines_raw (struct dwarf_section * section, if (uladv) state_machine_regs.view = 0; printf (_(" Advance PC by constant %" PRIu64 - " to 0x%" PRIx64 "%s\n"), + " to %#" PRIx64 "%s\n"), uladv, state_machine_regs.address, verbose_view && uladv ? _(" (reset view)") : ""); @@ -4798,7 +4798,7 @@ display_debug_lines_raw (struct dwarf_section * section, if (addrdelta) state_machine_regs.view = 0; printf (_(" Advance PC by constant %" PRIu64 - " to 0x%" PRIx64 "[%d]%s\n"), + " to %#" PRIx64 "[%d]%s\n"), uladv, state_machine_regs.address, state_machine_regs.op_index, verbose_view && addrdelta @@ -4811,7 +4811,7 @@ display_debug_lines_raw (struct dwarf_section * section, state_machine_regs.address += uladv; state_machine_regs.op_index = 0; printf (_(" Advance PC by fixed size amount %" PRIu64 - " to 0x%" PRIx64 "\n"), + " to %#" PRIx64 "\n"), uladv, state_machine_regs.address); /* Do NOT reset view. */ break; @@ -4836,7 +4836,7 @@ display_debug_lines_raw (struct dwarf_section * section, for (i = standard_opcodes[op_code - 1]; i > 0 ; --i) { READ_ULEB (uladv, data, end); - printf ("0x%" PRIx64 "%s", uladv, i == 1 ? "" : ", "); + printf ("%#" PRIx64 "%s", uladv, i == 1 ? "" : ", "); } putchar ('\n'); break; @@ -5476,7 +5476,7 @@ display_debug_lines_decoded (struct dwarf_section * section, uint64_t val; READ_ULEB (val, data, end); - printf ("0x%" PRIx64 "%s", val, i == 1 ? "" : ", "); + printf ("%#" PRIx64 "%s", val, i == 1 ? "" : ", "); } putchar ('\n'); break; @@ -5740,7 +5740,7 @@ display_debug_pubnames_worker (struct dwarf_section *section, names.pn_length); printf (_(" Version: %d\n"), names.pn_version); - printf (_(" Offset into .debug_info section: 0x%" PRIx64 "\n"), + printf (_(" Offset into .debug_info section: %#" PRIx64 "\n"), names.pn_offset); printf (_(" Size of area in .debug_info section: %" PRId64 "\n"), names.pn_size); @@ -6040,13 +6040,13 @@ display_debug_macro (struct dwarf_section *section, SAFE_BYTE_GET_AND_INC (flags, curr, 1, end); offset_size = (flags & 1) ? 8 : 4; - printf (_(" Offset: 0x%" PRIx64 "\n"), sec_offset); + printf (_(" Offset: %#" PRIx64 "\n"), sec_offset); printf (_(" Version: %d\n"), version); printf (_(" Offset size: %d\n"), offset_size); if (flags & 2) { SAFE_BYTE_GET_AND_INC (line_offset, curr, offset_size, end); - printf (_(" Offset into .debug_line: 0x%" PRIx64 "\n"), + printf (_(" Offset into .debug_line: %#" PRIx64 "\n"), line_offset); } if (flags & 4) @@ -6196,7 +6196,7 @@ display_debug_macro (struct dwarf_section *section, case DW_MACRO_import: SAFE_BYTE_GET_AND_INC (offset, curr, offset_size, end); - printf (_(" DW_MACRO_import - offset : 0x%" PRIx64 "\n"), + printf (_(" DW_MACRO_import - offset : %#" PRIx64 "\n"), offset); break; @@ -6204,7 +6204,7 @@ display_debug_macro (struct dwarf_section *section, READ_ULEB (lineno, curr, end); SAFE_BYTE_GET_AND_INC (offset, curr, offset_size, end); printf (_(" DW_MACRO_define_sup - lineno : %d" - " macro offset : 0x%" PRIx64 "\n"), + " macro offset : %#" PRIx64 "\n"), lineno, offset); break; @@ -6212,13 +6212,13 @@ display_debug_macro (struct dwarf_section *section, READ_ULEB (lineno, curr, end); SAFE_BYTE_GET_AND_INC (offset, curr, offset_size, end); printf (_(" DW_MACRO_undef_sup - lineno : %d" - " macro offset : 0x%" PRIx64 "\n"), + " macro offset : %#" PRIx64 "\n"), lineno, offset); break; case DW_MACRO_import_sup: SAFE_BYTE_GET_AND_INC (offset, curr, offset_size, end); - printf (_(" DW_MACRO_import_sup - offset : 0x%" PRIx64 "\n"), + printf (_(" DW_MACRO_import_sup - offset : %#" PRIx64 "\n"), offset); break; @@ -6233,7 +6233,7 @@ display_debug_macro (struct dwarf_section *section, else printf (" DW_MACRO_undef_strx "); if (do_wide) - printf (_("(with offset %" PRIx64 ") "), offset); + printf (_("(with offset %#" PRIx64 ") "), offset); printf (_("lineno : %d macro : %s\n"), lineno, string); break; @@ -6308,7 +6308,7 @@ display_debug_abbrev (struct dwarf_section *section, break; if (list->first_abbrev) - printf (_(" Number TAG (0x%" PRIx64 ")\n"), offset); + printf (_(" Number TAG (%#" PRIx64 ")\n"), offset); for (entry = list->first_abbrev; entry; entry = entry->next) { @@ -6948,7 +6948,7 @@ display_offset_entry_loclists (struct dwarf_section *section) uint32_t i; bool is_64bit; - printf (_("Table at Offset 0x%tx\n"), start - section->start); + printf (_("Table at Offset %#tx\n"), start - section->start); SAFE_BYTE_GET_AND_INC (length, start, 4, end); if (length == 0xffffffff) @@ -6964,7 +6964,7 @@ display_offset_entry_loclists (struct dwarf_section *section) SAFE_BYTE_GET_AND_INC (segment_selector_size, start, 1, end); SAFE_BYTE_GET_AND_INC (offset_entry_count, start, 4, end); - printf (_(" Length: 0x%" PRIx64 "\n"), length); + printf (_(" Length: %#" PRIx64 "\n"), length); printf (_(" DWARF version: %u\n"), version); printf (_(" Address size: %u\n"), address_size); printf (_(" Segment size: %u\n"), segment_selector_size); @@ -6993,7 +6993,7 @@ display_offset_entry_loclists (struct dwarf_section *section) return 0; } - printf (_("\n Offset Entries starting at 0x%tx:\n"), + printf (_("\n Offset Entries starting at %#tx:\n"), start - section->start); for (i = 0; i < offset_entry_count; i++) @@ -7001,7 +7001,7 @@ display_offset_entry_loclists (struct dwarf_section *section) uint64_t entry; SAFE_BYTE_GET_AND_INC (entry, start, is_64bit ? 8 : 4, end); - printf (_(" [%6u] 0x%" PRIx64 "\n"), i, entry); + printf (_(" [%6u] %#" PRIx64 "\n"), i, entry); } putchar ('\n'); @@ -7545,7 +7545,7 @@ display_debug_aranges (struct dwarf_section *section, printf (_(" Length: %" PRId64 "\n"), arange.ar_length); printf (_(" Version: %d\n"), arange.ar_version); - printf (_(" Offset into .debug_info: 0x%" PRIx64 "\n"), + printf (_(" Offset into .debug_info: %#" PRIx64 "\n"), arange.ar_info_offset); printf (_(" Pointer Size: %d\n"), arange.ar_pointer_size); printf (_(" Segment Size: %d\n"), arange.ar_segment_size); @@ -7588,7 +7588,7 @@ display_debug_aranges (struct dwarf_section *section, end_ranges); printf (" "); print_hex (address, address_size); - print_hex (length, address_size); + print_hex_ns (length, address_size); putchar ('\n'); } @@ -7667,7 +7667,7 @@ display_debug_addr (struct dwarf_section *section, unsigned int idx; unsigned int address_size = debug_addr_info [i]->pointer_size; - printf (_(" For compilation unit at offset 0x%" PRIx64 ":\n"), + printf (_(" For compilation unit at offset %#" PRIx64 ":\n"), debug_addr_info [i]->cu_offset); printf (_("\tIndex\tAddress\n")); @@ -7709,7 +7709,7 @@ display_debug_addr (struct dwarf_section *section, { uint64_t base = byte_get (entry, address_size); printf (_("\t%d:\t"), idx); - print_hex (base, address_size); + print_hex_ns (base, address_size); printf ("\n"); entry += address_size; idx++; @@ -7895,12 +7895,12 @@ display_debug_ranges_list (unsigned char * start, } print_hex (begin + base_address, pointer_size); - print_hex (end + base_address, pointer_size); + print_hex_ns (end + base_address, pointer_size); if (begin == end) - fputs (_("(start == end)"), stdout); + fputs (_(" (start == end)"), stdout); else if (begin > end) - fputs (_("(start > end)"), stdout); + fputs (_(" (start > end)"), stdout); putchar ('\n'); } @@ -8076,8 +8076,8 @@ display_debug_rnglists (struct dwarf_section *section) SAFE_BYTE_GET_AND_INC (segment_selector_size, start, 1, finish); SAFE_BYTE_GET_AND_INC (offset_entry_count, start, 4, finish); - printf (_(" Table at Offset: 0x%" PRIx64 ":\n"), offset); - printf (_(" Length: 0x%" PRIx64 "\n"), initial_length); + printf (_(" Table at Offset: %#" PRIx64 ":\n"), offset); + printf (_(" Length: %#" PRIx64 "\n"), initial_length); printf (_(" DWARF version: %u\n"), version); printf (_(" Address size: %u\n"), address_size); printf (_(" Segment size: %u\n"), segment_selector_size); @@ -8103,7 +8103,7 @@ display_debug_rnglists (struct dwarf_section *section) if (offset_entry_count != 0) { - printf (_("\n Offsets starting at 0x%tx:\n"), + printf (_("\n Offsets starting at %#tx:\n"), start - section->start); for (i = 0; i < offset_entry_count; i++) @@ -8111,7 +8111,7 @@ display_debug_rnglists (struct dwarf_section *section) uint64_t entry; SAFE_BYTE_GET_AND_INC (entry, start, offset_size, finish); - printf (_(" [%6u] 0x%" PRIx64 "\n"), i, entry); + printf (_(" [%6u] %#" PRIx64 "\n"), i, entry); } } else @@ -8122,7 +8122,7 @@ display_debug_rnglists (struct dwarf_section *section) uint64_t indx = start - table_start; offset = start - section->start; - printf (_("\n Offset: %" PRIx64 ", Index: 0x%" PRIx64 "\n"), + printf (_("\n Offset: %#" PRIx64 ", Index: %#" PRIx64 "\n"), offset, indx); printf (_(" Offset Begin End\n")); start = display_debug_rnglists_list @@ -10094,7 +10094,7 @@ display_debug_names (struct dwarf_section *section, void *file) uint64_t cu_offset; SAFE_BYTE_GET_AND_INC (cu_offset, hdrptr, offset_size, unit_end); - printf ("[%3u] 0x%" PRIx64 "\n", i, cu_offset); + printf ("[%3u] %#" PRIx64 "\n", i, cu_offset); } putchar ('\n'); @@ -10107,7 +10107,7 @@ display_debug_names (struct dwarf_section *section, void *file) uint64_t tu_offset; SAFE_BYTE_GET_AND_INC (tu_offset, hdrptr, offset_size, unit_end); - printf ("[%3u] 0x%" PRIx64 "\n", i, tu_offset); + printf ("[%3u] %#" PRIx64 "\n", i, tu_offset); } putchar ('\n'); @@ -10121,7 +10121,7 @@ display_debug_names (struct dwarf_section *section, void *file) SAFE_BYTE_GET_AND_INC (signature, hdrptr, 8, unit_end); printf (_("[%3u] "), i); - print_hex (signature, 8); + print_hex_ns (signature, 8); putchar ('\n'); } putchar ('\n'); @@ -10504,7 +10504,7 @@ display_gdb_index (struct dwarf_section *section, uint64_t cu_offset = byte_get_little_endian (cu_list + i * 16, 8); uint64_t cu_length = byte_get_little_endian (cu_list + i * 16 + 8, 8); - printf ("[%3u] 0x%" PRIx64 " - 0x%" PRIx64 "\n", + printf ("[%3u] %#" PRIx64 " - %#" PRIx64 "\n", i, cu_offset, cu_offset + cu_length - 1); } @@ -10515,9 +10515,9 @@ display_gdb_index (struct dwarf_section *section, uint64_t type_offset = byte_get_little_endian (tu_list + i * 24 + 8, 8); uint64_t signature = byte_get_little_endian (tu_list + i * 24 + 16, 8); - printf ("[%3u] 0x%" PRIx64 " 0x%" PRIx64 " ", + printf ("[%3u] %#" PRIx64 " %#" PRIx64 " ", i, tu_offset, type_offset); - print_hex (signature, 8); + print_hex_ns (signature, 8); printf ("\n"); } @@ -10774,7 +10774,7 @@ process_cu_tu_index (struct dwarf_section *section, int do_display) } if (do_display) - printf (_(" [%3d] Signature: 0x%" PRIx64 " Sections: "), + printf (_(" [%3d] Signature: %#" PRIx64 " Sections: "), i, signature); for (;;) { @@ -10888,7 +10888,7 @@ process_cu_tu_index (struct dwarf_section *section, int do_display) prow = poffsets + (row - 1) * ncols * 4; if (do_display) - printf (" [%3d] 0x%" PRIx64, i, signature); + printf (" [%3d] %#" PRIx64, i, signature); for (j = 0; j < ncols; j++) { unsigned char *p = prow + j * 4; @@ -10946,7 +10946,7 @@ process_cu_tu_index (struct dwarf_section *section, int do_display) prow = psizes + (row - 1) * ncols * 4; if (do_display) - printf (" [%3d] 0x%" PRIx64, i, signature); + printf (" [%3d] %#" PRIx64, i, signature); for (j = 0; j < ncols; j++) { diff --git a/binutils/testsuite/binutils-all/dw2-1.W b/binutils/testsuite/binutils-all/dw2-1.W index dba0483ca2f..b11596fefe9 100644 --- a/binutils/testsuite/binutils-all/dw2-1.W +++ b/binutils/testsuite/binutils-all/dw2-1.W @@ -3,13 +3,13 @@ Contents of the .z?debug_info section: - Compilation Unit @ offset 0x0: + Compilation Unit @ offset (0x)?0: Length: 0x4e \(32-bit\) Version: 2 - Abbrev Offset: 0x0 + Abbrev Offset: (0x)?0 Pointer Size: 4 <0><b>: Abbrev Number: 1 \(DW_TAG_compile_unit\) - <c> DW_AT_stmt_list : 0x0 + <c> DW_AT_stmt_list : (0x)?0 <10> DW_AT_high_pc : 0x. <14> DW_AT_low_pc : 0x. <18> DW_AT_name : file1.txt @@ -32,7 +32,7 @@ Contents of the .z?debug_info section: Raw dump of debug contents of section .z?debug_line: - Offset: 0x0 + Offset: (0x)?0 Length: 62 DWARF Version: 2 Prologue Length: 35 @@ -76,7 +76,7 @@ Raw dump of debug contents of section .z?debug_line: Contents of the .debug_abbrev section: - Number TAG \(0x0\) + Number TAG \((0x)?0\) 1 DW_TAG_compile_unit \[has children\] DW_AT_stmt_list DW_FORM_data4 DW_AT_high_pc DW_FORM_addr diff --git a/binutils/testsuite/binutils-all/dw2-3.W b/binutils/testsuite/binutils-all/dw2-3.W index 37fd4189dff..bfff6d40882 100644 --- a/binutils/testsuite/binutils-all/dw2-3.W +++ b/binutils/testsuite/binutils-all/dw2-3.W @@ -3,15 +3,15 @@ Contents of the .z?debug_info section: - Compilation Unit @ offset 0x0: + Compilation Unit @ offset (0x)?0: Length: 0x5e \(32-bit\) Version: 2 - Abbrev Offset: 0x0 + Abbrev Offset: (0x)?0 Pointer Size: 4 <0><b>: Abbrev Number: 1 \(DW_TAG_compile_unit\) - <c> DW_AT_stmt_list : 0x0 + <c> DW_AT_stmt_list : (0x)?0 <10> DW_AT_high_pc : 0x4 - <14> DW_AT_low_pc : 0x0 + <14> DW_AT_low_pc : (0x)?0 <18> DW_AT_name : file1.txt <22> DW_AT_producer : GNU C 3.3.3 <2e> DW_AT_language : 1 \(ANSI C\) @@ -21,7 +21,7 @@ Contents of the .z?debug_info section: <32> DW_AT_decl_line : 2 <33> DW_AT_name : func_cu1 <3c> DW_AT_type : <0x85> - <40> DW_AT_low_pc : 0x0 + <40> DW_AT_low_pc : (0x)?0 <44> DW_AT_high_pc : 0x4 <48> DW_AT_frame_base : 1 byte block: 55 \(DW_OP_reg5 \([^()]*\)\) <1><4a>: Abbrev Number: 3 \(DW_TAG_base_type\) @@ -58,7 +58,7 @@ Contents of the .z?debug_info section: Contents of the .z?debug_abbrev section: - Number TAG \(0x0\) + Number TAG \((0x)?0\) 1 DW_TAG_compile_unit \[has children\] DW_AT_stmt_list DW_FORM_data4 DW_AT_high_pc DW_FORM_addr @@ -112,7 +112,7 @@ Contents of the .z?debug_abbrev section: Raw dump of debug contents of section .z?debug_line: - Offset: 0x0 + Offset: (0x)?0 Length: 62 DWARF Version: 2 Prologue Length: 35 @@ -146,7 +146,7 @@ Raw dump of debug contents of section .z?debug_line: 1 0 0 0 file1.txt Line Number Statements: - \[0x0000002d\] Extended opcode 2: set Address to 0x0 + \[0x0000002d\] Extended opcode 2: set Address to (0x)?0 \[0x00000034\] Advance Line by 3 to 4 \[0x00000036\] Copy \[0x00000037\] Copy \(view 1\) diff --git a/binutils/testsuite/binutils-all/dw2-3gabi.W b/binutils/testsuite/binutils-all/dw2-3gabi.W index 5663517344f..a53fab670a6 100644 --- a/binutils/testsuite/binutils-all/dw2-3gabi.W +++ b/binutils/testsuite/binutils-all/dw2-3gabi.W @@ -3,15 +3,15 @@ Contents of the .debug_info section: - Compilation Unit @ offset 0x0: + Compilation Unit @ offset (0x)?0: Length: 0x5e \(32-bit\) Version: 2 - Abbrev Offset: 0x0 + Abbrev Offset: (0x)?0 Pointer Size: 4 <0><b>: Abbrev Number: 1 \(DW_TAG_compile_unit\) - <c> DW_AT_stmt_list : 0x0 + <c> DW_AT_stmt_list : (0x)?0 <10> DW_AT_high_pc : 0x4 - <14> DW_AT_low_pc : 0x0 + <14> DW_AT_low_pc : (0x)?0 <18> DW_AT_name : file1.txt <22> DW_AT_producer : GNU C 3.3.3 <2e> DW_AT_language : 1 \(ANSI C\) @@ -21,7 +21,7 @@ Contents of the .debug_info section: <32> DW_AT_decl_line : 2 <33> DW_AT_name : func_cu1 <3c> DW_AT_type : <0x85> - <40> DW_AT_low_pc : 0x0 + <40> DW_AT_low_pc : (0x)?0 <44> DW_AT_high_pc : 0x4 <48> DW_AT_frame_base : 1 byte block: 55 \(DW_OP_reg5 \([^()]*\)\) <1><4a>: Abbrev Number: 3 \(DW_TAG_base_type\) @@ -58,7 +58,7 @@ Contents of the .debug_info section: Contents of the .debug_abbrev section: - Number TAG \(0x0\) + Number TAG \((0x)?0\) 1 DW_TAG_compile_unit \[has children\] DW_AT_stmt_list DW_FORM_data4 DW_AT_high_pc DW_FORM_addr @@ -112,7 +112,7 @@ Contents of the .debug_abbrev section: Raw dump of debug contents of section .debug_line: - Offset: 0x0 + Offset: (0x)?0 Length: 62 DWARF Version: 2 Prologue Length: 35 @@ -146,7 +146,7 @@ Raw dump of debug contents of section .debug_line: 1 0 0 0 file1.txt Line Number Statements: - \[0x0000002d\] Extended opcode 2: set Address to 0x0 + \[0x0000002d\] Extended opcode 2: set Address to (0x)?0 \[0x00000034\] Advance Line by 3 to 4 \[0x00000036\] Copy \[0x00000037\] Copy \(view 1\) diff --git a/binutils/testsuite/binutils-all/dw2-ranges.W b/binutils/testsuite/binutils-all/dw2-ranges.W index 4dfd24834ca..bdf08f6862a 100644 --- a/binutils/testsuite/binutils-all/dw2-ranges.W +++ b/binutils/testsuite/binutils-all/dw2-ranges.W @@ -5,7 +5,7 @@ Contents of the \.debug_ranges section: Offset Begin End 00000000 ffffffff 00000004 \(base address\) - 00000000 00000004 00000008 + 00000000 00000004 00000008 ? 00000000 ffffffff 00000008 \(base address\) - 00000000 00000008 0000000c + 00000000 00000008 0000000c ? 00000000 <End of list> diff --git a/binutils/testsuite/binutils-all/dw5-op.W b/binutils/testsuite/binutils-all/dw5-op.W index 544a0712275..f1406c1f9d2 100644 --- a/binutils/testsuite/binutils-all/dw5-op.W +++ b/binutils/testsuite/binutils-all/dw5-op.W @@ -1,23 +1,23 @@ Contents of the .debug_info section: - Compilation Unit @ offset 0x0: + Compilation Unit @ offset (0x)?0: Length: 0x4e \(32-bit\) Version: 5 Unit Type: DW_UT_compile \(1\) - Abbrev Offset: 0x0 + Abbrev Offset: (0x)?0 Pointer Size: 8 <0><c>: Abbrev Number: 3 \(DW_TAG_compile_unit\) <d> DW_AT_producer : \(indirect string, offset: 0xa\): GNU C11 7.0.1 20170218 \(experimental\) -mtune=generic -march=x86-64 -gdwarf-5 -O2 <11> DW_AT_language : 29 \(C11\) <12> DW_AT_name : \(indirect line string, offset: 0x2\): main.c - <16> DW_AT_comp_dir : \(indirect line string, offset: 0x0\): - <1a> DW_AT_ranges : 0x0 - <1e> DW_AT_low_pc : 0x0 - <26> DW_AT_stmt_list : 0x0 + <16> DW_AT_comp_dir : \(indirect line string, offset: (0x)?0\): + <1a> DW_AT_ranges : (0x)?0 + <1e> DW_AT_low_pc : (0x)?0 + <26> DW_AT_stmt_list : (0x)?0 <1><2a>: Abbrev Number: 1 \(DW_TAG_base_type\) <2b> DW_AT_byte_size : 4 <2c> DW_AT_encoding : 5 \(signed\) - <2d> DW_AT_name : \(indirect string, offset: 0x0\): main + <2d> DW_AT_name : \(indirect string, offset: (0x)?0\): main <1><31>: Abbrev Number: 2 \(DW_TAG_variable\) <32> DW_AT_name : \(indirect string, offset: 0x5\): xvar <36> DW_AT_decl_file : 1 @@ -31,5 +31,5 @@ Contents of the .debug_info section: <4a> DW_AT_decl_line : 3 <4b> DW_AT_type : <0x2a> <4f> DW_AT_external : 1 - <4f> DW_AT_location : \(DW_OP_addrx <0x0>\) + <4f> DW_AT_location : \(DW_OP_addrx <(0x)?0>\) diff --git a/binutils/testsuite/binutils-all/dw5.W b/binutils/testsuite/binutils-all/dw5.W index bfcdac175ba..ff54134f29e 100644 --- a/binutils/testsuite/binutils-all/dw5.W +++ b/binutils/testsuite/binutils-all/dw5.W @@ -1,19 +1,19 @@ Contents of the .debug_info section: - Compilation Unit @ offset 0x0: + Compilation Unit @ offset (0x)?0: Length: 0x160 \(32-bit\) Version: 5 Unit Type: DW_UT_compile \(1\) - Abbrev Offset: 0x0 + Abbrev Offset: (0x)?0 Pointer Size: 8 <0><c>: Abbrev Number: 6 \(DW_TAG_compile_unit\) <d> DW_AT_producer : \(indirect string, offset: 0x43\): GNU C11 7.0.1 20170218 \(experimental\) -mtune=generic -march=x86-64 -gdwarf-5 -O2 <11> DW_AT_language : 29 \(C11\) <12> DW_AT_name : \(indirect line string, offset: 0x14\): main.c - <16> DW_AT_comp_dir : \(indirect line string, offset: 0x0\): + <16> DW_AT_comp_dir : \(indirect line string, offset: (0x)?0\): <1a> DW_AT_ranges : 0xc - <1e> DW_AT_low_pc : 0x0 - <26> DW_AT_stmt_list : 0x0 + <1e> DW_AT_low_pc : (0x)?0 + <26> DW_AT_stmt_list : (0x)?0 <1><2a>: Abbrev Number: 1 \(DW_TAG_base_type\) <2b> DW_AT_byte_size : 1 <2c> DW_AT_encoding : 8 \(unsigned char\) @@ -25,7 +25,7 @@ Contents of the .debug_info section: <1><38>: Abbrev Number: 1 \(DW_TAG_base_type\) <39> DW_AT_byte_size : 4 <3a> DW_AT_encoding : 7 \(unsigned\) - <3b> DW_AT_name : \(indirect string, offset: 0x0\): unsigned int + <3b> DW_AT_name : \(indirect string, offset: (0x)?0\): unsigned int <1><3f>: Abbrev Number: 1 \(DW_TAG_base_type\) <40> DW_AT_byte_size : 8 <41> DW_AT_encoding : 7 \(unsigned\) @@ -172,7 +172,7 @@ Contents of the .debug_info section: Contents of the .debug_abbrev section: - Number TAG \(0x0\) + Number TAG \((0x)?0\) 1 DW_TAG_base_type \[no children\] DW_AT_byte_size DW_FORM_data1 DW_AT_encoding DW_FORM_data1 @@ -289,7 +289,7 @@ Contents of the .debug_rnglists section: Raw dump of debug contents of section .debug_line: - Offset: 0x0 + Offset: (0x)?0 Length: 144 DWARF Version: 5 Address size \(bytes\): 8 @@ -318,7 +318,7 @@ Raw dump of debug contents of section .debug_line: The Directory Table \(offset 0x22, lines 3, columns 1\): Entry Name - 0 \(indirect line string, offset: 0x0\): + 0 \(indirect line string, offset: (0x)?0\): 1 \(indirect line string, offset: 0x1\): 2 \(indirect line string, offset: 0x22\): /usr/include diff --git a/binutils/testsuite/binutils-all/dwarf-attributes.W b/binutils/testsuite/binutils-all/dwarf-attributes.W index 4e8386ae880..cfc734c8448 100644 --- a/binutils/testsuite/binutils-all/dwarf-attributes.W +++ b/binutils/testsuite/binutils-all/dwarf-attributes.W @@ -1,10 +1,10 @@ Contents of the .debug_info section: - Compilation Unit @ offset 0x0: + Compilation Unit @ offset (0x)?0: Length: 0x40 \(32-bit\) Version: 5 Unit Type: DW_UT_compile \(1\) - Abbrev Offset: 0x0 + Abbrev Offset: (0x)?0 Pointer Size: 4 <0><c>: Abbrev Number: 1 \(User TAG value: 0x5555\) <d> DW_AT_ordering : 1 \(column major\) diff --git a/binutils/testsuite/binutils-all/i386/compressed-1a.d b/binutils/testsuite/binutils-all/i386/compressed-1a.d index bf04974a894..d8aabd66829 100644 --- a/binutils/testsuite/binutils-all/i386/compressed-1a.d +++ b/binutils/testsuite/binutils-all/i386/compressed-1a.d @@ -7,7 +7,7 @@ Contents of the .[z]?debug_abbrev section: - Number TAG \(0x0\) + Number TAG \((0x)?0\) 1 DW_TAG_compile_unit \[has children\] DW_AT_producer DW_FORM_strp DW_AT_language DW_FORM_data1 @@ -29,25 +29,25 @@ Contents of the .[z]?debug_abbrev section: Contents of the .[z]?debug_info section: - Compilation Unit @ offset 0x0: + Compilation Unit @ offset (0x)?0: Length: 0x46 \(32-bit\) Version: 3 - Abbrev Offset: 0x0 + Abbrev Offset: (0x)?0 Pointer Size: 4 <0><b>: Abbrev Number: 1 \(DW_TAG_compile_unit\) - <c> DW_AT_producer : \(indirect string, offset: 0x0\): GNU C 4.4.4 + <c> DW_AT_producer : \(indirect string, offset: (0x)?0\): GNU C 4.4.4 <10> DW_AT_language : 1 \(ANSI C\) <11> DW_AT_name : \(indirect string, offset: 0x18\): compressed-1.c <15> DW_AT_comp_dir : \(indirect string, offset: 0x16\): . - <19> DW_AT_low_pc : 0x0 + <19> DW_AT_low_pc : (0x)?0 <1d> DW_AT_high_pc : 0x1b - <21> DW_AT_stmt_list : 0x0 + <21> DW_AT_stmt_list : (0x)?0 <1><25>: Abbrev Number: 2 \(DW_TAG_subprogram\) <26> DW_AT_external : 1 <27> DW_AT_name : \(indirect string, offset: 0xc\): foo2 <2b> DW_AT_decl_file : 1 <2c> DW_AT_decl_line : 10 - <2d> DW_AT_low_pc : 0x0 + <2d> DW_AT_low_pc : (0x)?0 <31> DW_AT_high_pc : 0x2 <35> DW_AT_frame_base : 1 byte block: 9c \(DW_OP_call_frame_cfa\) <1><37>: Abbrev Number: 2 \(DW_TAG_subprogram\) @@ -62,7 +62,7 @@ Contents of the .[z]?debug_info section: Raw dump of debug contents of section .[z]?debug_line: - Offset: 0x0 + Offset: (0x)?0 Length: 64 DWARF Version: . Prologue Length: 37 @@ -93,10 +93,10 @@ Raw dump of debug contents of section .[z]?debug_line: 1 0 0 0 compressed-1.c Line Number Statements: - \[0x.*\] Extended opcode 2: set Address to 0x0 + \[0x.*\] Extended opcode 2: set Address to (0x)?0 \[0x.*\] Advance Line by 10 to 11 \[0x.*\] Copy - \[0x.*\] Special opcode 6: advance Address by 0 to 0x0 and Line by 1 to 12 \(view 1\) + \[0x.*\] Special opcode 6: advance Address by 0 to (0x)?0 and Line by 1 to 12 \(view 1\) \[0x.*\] Advance Line by -7 to 5 \[0x.*\] Special opcode 229: advance Address by 16 to 0x10 and Line by 0 to 5 \[0x.*\] Special opcode 49: advance Address by 3 to 0x13 and Line by 2 to 7 @@ -109,7 +109,7 @@ Contents of the .[z]?debug_pubnames section: Length: 32 Version: 2 - Offset into .[z]?debug_info section: 0x0 + Offset into .[z]?debug_info section: (0x)?0 Size of area in .[z]?debug_info section: 74 Offset Name @@ -120,13 +120,13 @@ Contents of the .[z]?debug_aranges section: Length: 28 Version: 2 - Offset into .[z]?debug_info: 0x0 + Offset into .[z]?debug_info: (0x)?0 Pointer Size: 4 Segment Size: 0 Address Length - 00000000 0000001b - 00000000 00000000 + 00000000 0000001b ? + 00000000 00000000 ? Contents of the .[z]?debug_str section: diff --git a/binutils/testsuite/binutils-all/libdw2-compressedgabi.out b/binutils/testsuite/binutils-all/libdw2-compressedgabi.out index 7bc4629ccc4..70fe78fafe3 100644 --- a/binutils/testsuite/binutils-all/libdw2-compressedgabi.out +++ b/binutils/testsuite/binutils-all/libdw2-compressedgabi.out @@ -4,13 +4,13 @@ dw2-1-compressedgabi.o: +file format .* Contents of the .debug_info section: - Compilation Unit @ offset 0x0: + Compilation Unit @ offset (0x)?0: Length: 0x4e \(32-bit\) Version: 2 - Abbrev Offset: 0x0 + Abbrev Offset: (0x)?0 Pointer Size: 4 <0><b>: Abbrev Number: 1 \(DW_TAG_compile_unit\) - <c> DW_AT_stmt_list : 0x0 + <c> DW_AT_stmt_list : (0x)?0 <10> DW_AT_high_pc : 0x. <14> DW_AT_low_pc : 0x. <18> DW_AT_name : file1.txt @@ -33,7 +33,7 @@ Contents of the .debug_info section: Raw dump of debug contents of section .debug_line: - Offset: 0x0 + Offset: (0x)?0 Length: 62 DWARF Version: 2 Prologue Length: 35 @@ -77,7 +77,7 @@ Raw dump of debug contents of section .debug_line: Contents of the .debug_abbrev section: - Number TAG \(0x0\) + Number TAG \((0x)?0\) 1 DW_TAG_compile_unit \[has children\] DW_AT_stmt_list DW_FORM_data4 DW_AT_high_pc DW_FORM_addr @@ -106,15 +106,15 @@ dw2-2-compressedgabi.o: +file format .* Contents of the .debug_info section: - Compilation Unit @ offset 0x0: + Compilation Unit @ offset (0x)?0: Length: 0x4e \(32-bit\) Version: 2 - Abbrev Offset: 0x0 + Abbrev Offset: (0x)?0 Pointer Size: 4 <0><b>: Abbrev Number: 1 \(DW_TAG_compile_unit\) - <c> DW_AT_stmt_list : 0x0 + <c> DW_AT_stmt_list : (0x)?0 <10> DW_AT_high_pc : 0x4 - <14> DW_AT_low_pc : 0x0 + <14> DW_AT_low_pc : (0x)?0 <18> DW_AT_name : file1.txt <22> DW_AT_producer : GNU C 3.3.3 <2e> DW_AT_language : 1 \(ANSI C\) @@ -124,7 +124,7 @@ Contents of the .debug_info section: <32> DW_AT_decl_line : 2 <33> DW_AT_name : func_cu2 <3c> DW_AT_type : <0x4a> - <40> DW_AT_low_pc : 0x0 + <40> DW_AT_low_pc : (0x)?0 <44> DW_AT_high_pc : 0x4 <48> DW_AT_frame_base : 1 byte block: 55 \(DW_OP_reg5 \(.*\)\) <1><4a>: Abbrev Number: 3 \(DW_TAG_base_type\) @@ -135,7 +135,7 @@ Contents of the .debug_info section: Raw dump of debug contents of section .debug_line: - Offset: 0x0 + Offset: (0x)?0 Length: 62 DWARF Version: 2 Prologue Length: 35 @@ -169,7 +169,7 @@ Raw dump of debug contents of section .debug_line: 1 0 0 0 file1.txt Line Number Statements: - \[0x0000002d\] Extended opcode 2: set Address to 0x0 + \[0x0000002d\] Extended opcode 2: set Address to (0x)?0 \[0x00000034\] Advance Line by 3 to 4 \[0x00000036\] Copy \[0x00000037\] Copy \(view 1\) @@ -179,7 +179,7 @@ Raw dump of debug contents of section .debug_line: Contents of the .debug_abbrev section: - Number TAG \(0x0\) + Number TAG \((0x)?0\) 1 DW_TAG_compile_unit \[has children\] DW_AT_stmt_list DW_FORM_data4 DW_AT_high_pc DW_FORM_addr @@ -209,15 +209,15 @@ dw2-3-compressedgabi.o: +file format .* Contents of the .debug_info section: - Compilation Unit @ offset 0x0: + Compilation Unit @ offset (0x)?0: Length: 0x5e \(32-bit\) Version: 2 - Abbrev Offset: 0x0 + Abbrev Offset: (0x)?0 Pointer Size: 4 <0><b>: Abbrev Number: 1 \(DW_TAG_compile_unit\) - <c> DW_AT_stmt_list : 0x0 + <c> DW_AT_stmt_list : (0x)?0 <10> DW_AT_high_pc : 0x4 - <14> DW_AT_low_pc : 0x0 + <14> DW_AT_low_pc : (0x)?0 <18> DW_AT_name : file1.txt <22> DW_AT_producer : GNU C 3.3.3 <2e> DW_AT_language : 1 \(ANSI C\) @@ -227,7 +227,7 @@ Contents of the .debug_info section: <32> DW_AT_decl_line : 2 <33> DW_AT_name : func_cu1 <3c> DW_AT_type : <0x85> - <40> DW_AT_low_pc : 0x0 + <40> DW_AT_low_pc : (0x)?0 <44> DW_AT_high_pc : 0x4 <48> DW_AT_frame_base : 1 byte block: 55 \(DW_OP_reg5 \([^()]*\)\) <1><4a>: Abbrev Number: 3 \(DW_TAG_base_type\) @@ -264,7 +264,7 @@ Contents of the .debug_info section: Contents of the .debug_abbrev section: - Number TAG \(0x0\) + Number TAG \((0x)?0\) 1 DW_TAG_compile_unit \[has children\] DW_AT_stmt_list DW_FORM_data4 DW_AT_high_pc DW_FORM_addr @@ -318,7 +318,7 @@ Contents of the .debug_abbrev section: Raw dump of debug contents of section .debug_line: - Offset: 0x0 + Offset: (0x)?0 Length: 62 DWARF Version: 2 Prologue Length: 35 @@ -352,7 +352,7 @@ Raw dump of debug contents of section .debug_line: 1 0 0 0 file1.txt Line Number Statements: - \[0x0000002d\] Extended opcode 2: set Address to 0x0 + \[0x0000002d\] Extended opcode 2: set Address to (0x)?0 \[0x00000034\] Advance Line by 3 to 4 \[0x00000036\] Copy \[0x00000037\] Copy \(view 1\) diff --git a/binutils/testsuite/binutils-all/objdump.W b/binutils/testsuite/binutils-all/objdump.W index 8d2150593c9..ddeeec9eb1b 100644 --- a/binutils/testsuite/binutils-all/objdump.W +++ b/binutils/testsuite/binutils-all/objdump.W @@ -3,13 +3,13 @@ Contents of the .z?debug_info section: - Compilation Unit @ offset 0x0: + Compilation Unit @ offset (0x)?0: Length: 0x4e \(32-bit\) Version: 2 - Abbrev Offset: 0x0 + Abbrev Offset: (0x)?0 Pointer Size: 4 <0><b>: Abbrev Number: 1 \(DW_TAG_compile_unit\) - <c> DW_AT_stmt_list : 0x0 + <c> DW_AT_stmt_list : (0x)?0 <10> DW_AT_high_pc : 0x. <14> DW_AT_low_pc : 0x. <18> DW_AT_name : file1.txt @@ -32,7 +32,7 @@ Contents of the .z?debug_info section: Raw dump of debug contents of section .z?debug_line: - Offset: 0x0 + Offset: (0x)?0 Length: 62 DWARF Version: 2 Prologue Length: 35 @@ -76,7 +76,7 @@ Raw dump of debug contents of section .z?debug_line: Contents of the .zdebug_abbrev section: - Number TAG \(0x0\) + Number TAG \((0x)?0\) 1 DW_TAG_compile_unit \[has children\] DW_AT_stmt_list DW_FORM_data4 DW_AT_high_pc DW_FORM_addr diff --git a/binutils/testsuite/binutils-all/objdump.WK2 b/binutils/testsuite/binutils-all/objdump.WK2 index be7817f2409..66c805d7c83 100644 --- a/binutils/testsuite/binutils-all/objdump.WK2 +++ b/binutils/testsuite/binutils-all/objdump.WK2 @@ -14,13 +14,13 @@ Contents of the .debug_str section \(loaded from .*debuglink.o\): Contents of the .debug_info section \(loaded from .*debuglink.o\): - Compilation Unit @ offset 0x0: + Compilation Unit @ offset (0x)?0: Length: 0x12 \(32-bit\) Version: 4 - Abbrev Offset: 0x0 + Abbrev Offset: (0x)?0 Pointer Size: 4 <0><b>: Abbrev Number: 1 \(DW_TAG_compile_unit\) - <c> DW_AT_name : \(indirect string, offset: 0x0\): string-1 + <c> DW_AT_name : \(indirect string, offset: (0x)?0\): string-1 <0><10>: Abbrev Number: 2 \(DW_TAG_subprogram\) - <11> DW_AT_name : \(alt indirect string, offset: 0x0\) string-3 + <11> DW_AT_name : \(alt indirect string, offset: (0x)?0\) string-3 #pass diff --git a/binutils/testsuite/binutils-all/pr26112.r b/binutils/testsuite/binutils-all/pr26112.r index f28441393e0..30a86aebd20 100644 --- a/binutils/testsuite/binutils-all/pr26112.r +++ b/binutils/testsuite/binutils-all/pr26112.r @@ -1,9 +1,9 @@ Contents of the .debug_macro section: - Offset: 0x0 + Offset: (0x)?0 Version: 5 Offset size: 4 - Offset into .debug_line: 0x0 + Offset into .debug_line: (0x)?0 DW_MACRO_start_file - lineno: 0 filenum: 1 DW_MACRO_define_strx lineno : 1 macro : - diff --git a/binutils/testsuite/binutils-all/pr26160.r b/binutils/testsuite/binutils-all/pr26160.r index 1536e0142d2..e8ec2adb119 100644 --- a/binutils/testsuite/binutils-all/pr26160.r +++ b/binutils/testsuite/binutils-all/pr26160.r @@ -1,15 +1,15 @@ Contents of the .debug_info.dwo section: - Compilation Unit @ offset 0x0: + Compilation Unit @ offset (0x)?0: Length: 0x178 \(32-bit\) Version: 4 - Abbrev Offset: 0x0 + Abbrev Offset: (0x)?0 Pointer Size: 8 Section contributions: - .debug_abbrev.dwo: 0x0 0x154 - .debug_line.dwo: 0x0 0x40 - .debug_loc.dwo: 0x0 0x0 - .debug_str_offsets.dwo: 0x0 0x14 + .debug_abbrev.dwo: (0x)?0 0x154 + .debug_line.dwo: (0x)?0 0x40 + .debug_loc.dwo: (0x)?0 (0x)?0 + .debug_str_offsets.dwo: (0x)?0 0x14 <0><b>: Abbrev Number: 12 \(DW_TAG_compile_unit\) <c> DW_AT_producer : GNU C\+\+ 4.7.x-google 20120720 \(prerelease\) <37> DW_AT_language : 4 \(C\+\+\) @@ -30,7 +30,7 @@ Contents of the .debug_info.dwo section: <a5> DW_AT_decl_file : 1 <a6> DW_AT_decl_line : 30 <a7> DW_AT_type : <0x90> - <ab> DW_AT_low_pc : \(addr_index: 0x0\): <no .debug_addr section> + <ab> DW_AT_low_pc : \(addr_index: (0x)?0\): <no .debug_addr section> <ac> DW_AT_high_pc : 0x304 <b4> DW_AT_frame_base : 1 byte block: 9c \(DW_OP_call_frame_cfa\) <b6> DW_AT_GNU_all_tail_call_sites: 1 @@ -121,12 +121,12 @@ Contents of the .debug_info.dwo section: Compilation Unit @ offset 0x17c: Length: 0x5af \(32-bit\) Version: 4 - Abbrev Offset: 0x0 + Abbrev Offset: (0x)?0 Pointer Size: 8 Section contributions: .debug_abbrev.dwo: 0x154 0x21d .debug_line.dwo: 0x40 0x3d - .debug_loc.dwo: 0x0 0x0 + .debug_loc.dwo: (0x)?0 (0x)?0 .debug_str_offsets.dwo: 0x14 0x44 <0><187>: Abbrev Number: 12 \(DW_TAG_compile_unit\) <188> DW_AT_producer : GNU C\+\+ 4.7.x-google 20120720 \(prerelease\) @@ -141,7 +141,7 @@ Contents of the .debug_info.dwo section: <215> DW_AT_sibling : <0x242> <2><219>: Abbrev Number: 14 \(DW_TAG_subprogram\) <21a> DW_AT_external : 1 - <21a> DW_AT_name : \(indexed string: 0x0\): testcase1 + <21a> DW_AT_name : \(indexed string: (0x)?0\): testcase1 <21b> DW_AT_decl_file : 1 <21c> DW_AT_decl_line : 28 <21d> DW_AT_linkage_name: \(indexed string: 0xc\): _ZN2C19testcase1Ev @@ -194,7 +194,7 @@ Contents of the .debug_info.dwo section: <267> DW_AT_sibling : <0x294> <2><26b>: Abbrev Number: 14 \(DW_TAG_subprogram\) <26c> DW_AT_external : 1 - <26c> DW_AT_name : \(indexed string: 0x0\): testcase1 + <26c> DW_AT_name : \(indexed string: (0x)?0\): testcase1 <26d> DW_AT_decl_file : 1 <26e> DW_AT_decl_line : 40 <26f> DW_AT_linkage_name: \(indexed string: 0x7\): _ZN2C29testcase1Ev @@ -239,7 +239,7 @@ Contents of the .debug_info.dwo section: <2aa> DW_AT_sibling : <0x2cd> <2><2ae>: Abbrev Number: 14 \(DW_TAG_subprogram\) <2af> DW_AT_external : 1 - <2af> DW_AT_name : \(indexed string: 0x0\): testcase1 + <2af> DW_AT_name : \(indexed string: (0x)?0\): testcase1 <2b0> DW_AT_decl_file : 1 <2b1> DW_AT_decl_line : 50 <2b2> DW_AT_linkage_name: \(indexed string: 0x2\): _ZN2C39testcase1Ev @@ -274,7 +274,7 @@ Contents of the .debug_info.dwo section: <2dd> DW_AT_decl_file : 1 <2de> DW_AT_decl_line : 70 <2df> DW_AT_linkage_name: _Z4f13iv - <2e8> DW_AT_low_pc : \(addr_index: 0x0\): <no .debug_addr section> + <2e8> DW_AT_low_pc : \(addr_index: (0x)?0\): <no .debug_addr section> <2e9> DW_AT_high_pc : 0x6 <2f1> DW_AT_frame_base : 1 byte block: 9c \(DW_OP_call_frame_cfa\) <2f3> DW_AT_GNU_all_call_sites: 1 @@ -758,13 +758,13 @@ Contents of the .debug_info.dwo section: Compilation Unit @ offset 0x72f: Length: 0xcb \(32-bit\) Version: 4 - Abbrev Offset: 0x0 + Abbrev Offset: (0x)?0 Pointer Size: 8 Section contributions: .debug_abbrev.dwo: 0x371 0xbd .debug_line.dwo: 0x7d 0x3e - .debug_loc.dwo: 0x0 0x0 - .debug_str_offsets.dwo: 0x0 0x0 + .debug_loc.dwo: (0x)?0 (0x)?0 + .debug_str_offsets.dwo: (0x)?0 (0x)?0 <0><73a>: Abbrev Number: 10 \(DW_TAG_compile_unit\) <73b> DW_AT_producer : GNU C\+\+ 4.7.x-google 20120720 \(prerelease\) <766> DW_AT_language : 4 \(C\+\+\) @@ -786,7 +786,7 @@ Contents of the .debug_info.dwo section: <7d3> DW_AT_decl_line : 32 <7d4> DW_AT_linkage_name: _Z4t16av <7dd> DW_AT_type : <0x7c4> - <7e1> DW_AT_low_pc : \(addr_index: 0x0\): <no .debug_addr section> + <7e1> DW_AT_low_pc : \(addr_index: (0x)?0\): <no .debug_addr section> <7e2> DW_AT_high_pc : 0x13 <7ea> DW_AT_frame_base : 1 byte block: 9c \(DW_OP_call_frame_cfa\) <7ec> DW_AT_GNU_all_tail_call_sites: 1 @@ -801,12 +801,12 @@ Contents of the .debug_info.dwo section: Compilation Unit @ offset 0x7fe: Length: 0x329 \(32-bit\) Version: 4 - Abbrev Offset: 0x0 + Abbrev Offset: (0x)?0 Pointer Size: 8 Section contributions: .debug_abbrev.dwo: 0x42e 0x1f2 .debug_line.dwo: 0xbb 0x3d - .debug_loc.dwo: 0x0 0x0 + .debug_loc.dwo: (0x)?0 (0x)?0 .debug_str_offsets.dwo: 0x58 0x18 <0><809>: Abbrev Number: 12 \(DW_TAG_compile_unit\) <80a> DW_AT_producer : GNU C\+\+ 4.7.x-google 20120720 \(prerelease\) @@ -878,7 +878,7 @@ Contents of the .debug_info.dwo section: <908> DW_AT_decl_file : 1 <909> DW_AT_decl_line : 70 <90a> DW_AT_linkage_name: _Z4f13iv - <913> DW_AT_low_pc : \(addr_index: 0x0\): <no .debug_addr section> + <913> DW_AT_low_pc : \(addr_index: (0x)?0\): <no .debug_addr section> <914> DW_AT_high_pc : 0x6 <91c> DW_AT_frame_base : 1 byte block: 9c \(DW_OP_call_frame_cfa\) <91e> DW_AT_GNU_all_call_sites: 1 @@ -1099,22 +1099,22 @@ Contents of the .debug_info.dwo section: Contents of the .debug_types.dwo section: - Compilation Unit @ offset 0x0: + Compilation Unit @ offset (0x)?0: Length: 0xf7 \(32-bit\) Version: 4 - Abbrev Offset: 0x0 + Abbrev Offset: (0x)?0 Pointer Size: 8 Signature: 0xb534bdc1f01629bb Type Offset: 0x25 Section contributions: - .debug_abbrev.dwo: 0x0 0x154 - .debug_line.dwo: 0x0 0x40 - .debug_loc.dwo: 0x0 0x0 - .debug_str_offsets.dwo: 0x0 0x14 + .debug_abbrev.dwo: (0x)?0 0x154 + .debug_line.dwo: (0x)?0 0x40 + .debug_loc.dwo: (0x)?0 (0x)?0 + .debug_str_offsets.dwo: (0x)?0 0x14 <0><17>: Abbrev Number: 1 \(DW_TAG_type_unit\) <18> DW_AT_language : 4 \(C\+\+\) <19> DW_AT_GNU_odr_signature: 0x880a5c4d6e59da8a - <21> DW_AT_stmt_list : 0x0 + <21> DW_AT_stmt_list : (0x)?0 <1><25>: Abbrev Number: 2 \(DW_TAG_class_type\) <26> DW_AT_name : C3 <29> DW_AT_byte_size : 4 @@ -1130,7 +1130,7 @@ Contents of the .debug_types.dwo section: <39> DW_AT_accessibility: 1 \(public\) <2><3a>: Abbrev Number: 4 \(DW_TAG_subprogram\) <3b> DW_AT_external : 1 - <3b> DW_AT_name : \(indexed string: 0x0\): testcase1 + <3b> DW_AT_name : \(indexed string: (0x)?0\): testcase1 <3c> DW_AT_decl_file : 2 <3d> DW_AT_decl_line : 50 <3e> DW_AT_linkage_name: _ZN2C39testcase1Ev @@ -1208,19 +1208,19 @@ Contents of the .debug_types.dwo section: Compilation Unit @ offset 0xfb: Length: 0xf1 \(32-bit\) Version: 4 - Abbrev Offset: 0x0 + Abbrev Offset: (0x)?0 Pointer Size: 8 Signature: 0xab98c7bc886f5266 Type Offset: 0x25 Section contributions: - .debug_abbrev.dwo: 0x0 0x154 - .debug_line.dwo: 0x0 0x40 - .debug_loc.dwo: 0x0 0x0 - .debug_str_offsets.dwo: 0x0 0x14 + .debug_abbrev.dwo: (0x)?0 0x154 + .debug_line.dwo: (0x)?0 0x40 + .debug_loc.dwo: (0x)?0 (0x)?0 + .debug_str_offsets.dwo: (0x)?0 0x14 <0><112>: Abbrev Number: 1 \(DW_TAG_type_unit\) <113> DW_AT_language : 4 \(C\+\+\) <114> DW_AT_GNU_odr_signature: 0xae4af0d8bfcef94b - <11c> DW_AT_stmt_list : 0x0 + <11c> DW_AT_stmt_list : (0x)?0 <1><120>: Abbrev Number: 2 \(DW_TAG_class_type\) <121> DW_AT_name : C2 <124> DW_AT_byte_size : 4 @@ -1236,7 +1236,7 @@ Contents of the .debug_types.dwo section: <134> DW_AT_accessibility: 1 \(public\) <2><135>: Abbrev Number: 4 \(DW_TAG_subprogram\) <136> DW_AT_external : 1 - <136> DW_AT_name : \(indexed string: 0x0\): testcase1 + <136> DW_AT_name : \(indexed string: (0x)?0\): testcase1 <137> DW_AT_decl_file : 2 <138> DW_AT_decl_line : 40 <139> DW_AT_linkage_name: _ZN2C29testcase1Ev @@ -1309,19 +1309,19 @@ Contents of the .debug_types.dwo section: Compilation Unit @ offset 0x1f0: Length: 0x141 \(32-bit\) Version: 4 - Abbrev Offset: 0x0 + Abbrev Offset: (0x)?0 Pointer Size: 8 Signature: 0xb5faa2a4b7a919c4 Type Offset: 0x25 Section contributions: - .debug_abbrev.dwo: 0x0 0x154 - .debug_line.dwo: 0x0 0x40 - .debug_loc.dwo: 0x0 0x0 - .debug_str_offsets.dwo: 0x0 0x14 + .debug_abbrev.dwo: (0x)?0 0x154 + .debug_line.dwo: (0x)?0 0x40 + .debug_loc.dwo: (0x)?0 (0x)?0 + .debug_str_offsets.dwo: (0x)?0 0x14 <0><207>: Abbrev Number: 1 \(DW_TAG_type_unit\) <208> DW_AT_language : 4 \(C\+\+\) <209> DW_AT_GNU_odr_signature: 0xc7fbeb753b05ade3 - <211> DW_AT_stmt_list : 0x0 + <211> DW_AT_stmt_list : (0x)?0 <1><215>: Abbrev Number: 2 \(DW_TAG_class_type\) <216> DW_AT_name : C1 <219> DW_AT_byte_size : 4 @@ -1337,7 +1337,7 @@ Contents of the .debug_types.dwo section: <229> DW_AT_accessibility: 1 \(public\) <2><22a>: Abbrev Number: 4 \(DW_TAG_subprogram\) <22b> DW_AT_external : 1 - <22b> DW_AT_name : \(indexed string: 0x0\): testcase1 + <22b> DW_AT_name : \(indexed string: (0x)?0\): testcase1 <22c> DW_AT_decl_file : 2 <22d> DW_AT_decl_line : 28 <22e> DW_AT_linkage_name: _ZN2C19testcase1Ev diff --git a/binutils/testsuite/binutils-all/readelf.h b/binutils/testsuite/binutils-all/readelf.h index 01103fbab39..05858d7527c 100644 --- a/binutils/testsuite/binutils-all/readelf.h +++ b/binutils/testsuite/binutils-all/readelf.h @@ -8,7 +8,7 @@ ELF Header: Type: REL \(Relocatable file\) Machine: .* Version: 0x1 - Entry point address: 0x0 + Entry point address: (0x)?0 Start of program headers: 0 \(bytes into file\) Start of section headers: .* \(bytes into file\) Flags: .* diff --git a/binutils/testsuite/binutils-all/readelf.h.thin b/binutils/testsuite/binutils-all/readelf.h.thin index 32ea2b7d6f1..4be5373f7a8 100644 --- a/binutils/testsuite/binutils-all/readelf.h.thin +++ b/binutils/testsuite/binutils-all/readelf.h.thin @@ -10,7 +10,7 @@ ELF Header: Type: REL \(Relocatable file\) Machine: .* Version: 0x1 - Entry point address: 0x0 + Entry point address: (0x)?0 Start of program headers: 0 \(bytes into file\) Start of section headers: .* \(bytes into file\) Flags: .* diff --git a/binutils/testsuite/binutils-all/readelf.wKis b/binutils/testsuite/binutils-all/readelf.wKis index a8ab25221bc..0028fc2a4fb 100644 --- a/binutils/testsuite/binutils-all/readelf.wKis +++ b/binutils/testsuite/binutils-all/readelf.wKis @@ -6,15 +6,15 @@ Contents of the .debug_str section \(loaded from .*debuglink.o\): #... Contents of the .debug_info section \(loaded from .*debuglink.o\): - Compilation Unit @ offset 0x0: + Compilation Unit @ offset (0x)?0: Length: 0x12 \(32-bit\) Version: 4 - Abbrev Offset: 0x0 + Abbrev Offset: (0x)?0 Pointer Size: 4 <0><b>: Abbrev Number: 1 \(DW_TAG_compile_unit\) - <c> DW_AT_name : \(indirect string, offset: 0x0\): string-1 + <c> DW_AT_name : \(indirect string, offset: (0x)?0\): string-1 <0><10>: Abbrev Number: 2 \(DW_TAG_subprogram\) - <11> DW_AT_name : \(alt indirect string, offset: 0x0\) string-3 + <11> DW_AT_name : \(alt indirect string, offset: (0x)?0\) string-3 #... Contents of the .debug_str section \(loaded from .*linkdebug.debug\): diff --git a/binutils/testsuite/binutils-all/readelf.wa b/binutils/testsuite/binutils-all/readelf.wa index 43d60b1754a..aba110637da 100644 --- a/binutils/testsuite/binutils-all/readelf.wa +++ b/binutils/testsuite/binutils-all/readelf.wa @@ -1,6 +1,6 @@ Contents of the .zdebug_abbrev section: - Number TAG (0x0) + Number TAG (0) 1 DW_TAG_compile_unit [has children] DW_AT_stmt_list DW_FORM_data4 DW_AT_high_pc DW_FORM_addr diff --git a/binutils/testsuite/binutils-all/testranges-ia64.d b/binutils/testsuite/binutils-all/testranges-ia64.d index 9713236b326..e1e29e71632 100644 --- a/binutils/testsuite/binutils-all/testranges-ia64.d +++ b/binutils/testsuite/binutils-all/testranges-ia64.d @@ -7,9 +7,9 @@ Contents of the .debug_ranges section: Offset Begin End - 00000000 00000001 00000002 + 00000000 00000001 00000002 ? 00000000 <End of list> - 00000010 00000000 00000002 + 00000010 00000000 00000002 ? 00000010 <End of list> #pass diff --git a/binutils/testsuite/binutils-all/testranges.d b/binutils/testsuite/binutils-all/testranges.d index ba07a6f3058..dd2017557e7 100644 --- a/binutils/testsuite/binutils-all/testranges.d +++ b/binutils/testsuite/binutils-all/testranges.d @@ -7,9 +7,9 @@ Contents of the \.z?debug_ranges section: Offset Begin End - 00000000 00000001 00000002 + 00000000 00000001 00000002 ? 00000000 <End of list> - 00000010 00000000 00000002 + 00000010 00000000 00000002 ? 00000010 <End of list> #pass diff --git a/binutils/testsuite/binutils-all/x86-64/compressed-1a.d b/binutils/testsuite/binutils-all/x86-64/compressed-1a.d index c4898d7748d..e125829bf0f 100644 --- a/binutils/testsuite/binutils-all/x86-64/compressed-1a.d +++ b/binutils/testsuite/binutils-all/x86-64/compressed-1a.d @@ -7,7 +7,7 @@ Contents of the .[z]?debug_abbrev section: - Number TAG \(0x0\) + Number TAG \((0x)?0\) 1 DW_TAG_compile_unit \[has children\] DW_AT_producer DW_FORM_strp DW_AT_language DW_FORM_data1 @@ -29,25 +29,25 @@ Contents of the .[z]?debug_abbrev section: Contents of the .[z]?debug_info section: - Compilation Unit @ offset 0x0: + Compilation Unit @ offset (0x)?0: Length: 0x5e \(32-bit\) Version: 3 - Abbrev Offset: 0x0 + Abbrev Offset: (0x)?0 Pointer Size: 8 <0><b>: Abbrev Number: 1 \(DW_TAG_compile_unit\) - <c> DW_AT_producer : \(indirect string, offset: 0x0\): GNU C 4.4.4 + <c> DW_AT_producer : \(indirect string, offset: (0x)?0\): GNU C 4.4.4 <10> DW_AT_language : 1 \(ANSI C\) <11> DW_AT_name : \(indirect string, offset: 0x18\): compressed-1.c <15> DW_AT_comp_dir : \(indirect string, offset: 0x16\): . - <19> DW_AT_low_pc : 0x0 + <19> DW_AT_low_pc : (0x)?0 <21> DW_AT_high_pc : 0x15 - <29> DW_AT_stmt_list : 0x0 + <29> DW_AT_stmt_list : (0x)?0 <1><2d>: Abbrev Number: 2 \(DW_TAG_subprogram\) <2e> DW_AT_external : 1 <2f> DW_AT_name : \(indirect string, offset: 0xc\): foo2 <33> DW_AT_decl_file : 1 <34> DW_AT_decl_line : 10 - <35> DW_AT_low_pc : 0x0 + <35> DW_AT_low_pc : (0x)?0 <3d> DW_AT_high_pc : 0x2 <45> DW_AT_frame_base : 1 byte block: 9c \(DW_OP_call_frame_cfa\) <1><47>: Abbrev Number: 2 \(DW_TAG_subprogram\) @@ -62,7 +62,7 @@ Contents of the .[z]?debug_info section: Raw dump of debug contents of section .[z]?debug_line: - Offset: 0x0 + Offset: (0x)?0 Length: 67 DWARF Version: . Prologue Length: 37 @@ -93,10 +93,10 @@ Raw dump of debug contents of section .[z]?debug_line: 1 0 0 0 compressed-1.c Line Number Statements: - \[0x.*\] Extended opcode 2: set Address to 0x0 + \[0x.*\] Extended opcode 2: set Address to (0x)?0 \[0x.*\] Advance Line by 10 to 11 \[0x.*\] Copy - \[0x.*\] Special opcode 6: advance Address by 0 to 0x0 and Line by 1 to 12 \(view 1\) + \[0x.*\] Special opcode 6: advance Address by 0 to (0x)?0 and Line by 1 to 12 \(view 1\) \[0x.*\] Advance Line by -7 to 5 \[0x.*\] Special opcode 229: advance Address by 16 to 0x10 and Line by 0 to 5 \[0x.*\] Special opcode 6: advance Address by 0 to 0x10 and Line by 1 to 6 \(view 1\) @@ -108,7 +108,7 @@ Contents of the .[z]?debug_pubnames section: Length: 32 Version: 2 - Offset into .[z]?debug_info section: 0x0 + Offset into .[z]?debug_info section: (0x)?0 Size of area in .[z]?debug_info section: 98 Offset Name @@ -119,13 +119,13 @@ Contents of the .[z]?debug_aranges section: Length: 44 Version: 2 - Offset into .[z]?debug_info: 0x0 + Offset into .[z]?debug_info: (0x)?0 Pointer Size: 8 Segment Size: 0 Address Length - 0000000000000000 0000000000000015 - 0000000000000000 0000000000000000 + 0000000000000000 0000000000000015 ? + 0000000000000000 0000000000000000 ? Contents of the .[z]?debug_str section: diff --git a/binutils/testsuite/binutils-all/x86-64/pr26808.dump b/binutils/testsuite/binutils-all/x86-64/pr26808.dump index dc879830f46..db6f14d114f 100644 --- a/binutils/testsuite/binutils-all/x86-64/pr26808.dump +++ b/binutils/testsuite/binutils-all/x86-64/pr26808.dump @@ -1,15 +1,15 @@ Contents of the .debug_info.dwo section: - Compilation Unit @ offset 0x0: + Compilation Unit @ offset 0: Length: 0x178 (32-bit) Version: 4 - Abbrev Offset: 0x0 + Abbrev Offset: 0 Pointer Size: 8 Section contributions: - .debug_abbrev.dwo: 0x0 0x154 - .debug_line.dwo: 0x0 0x40 - .debug_loc.dwo: 0x0 0x0 - .debug_str_offsets.dwo: 0x0 0x14 + .debug_abbrev.dwo: 0 0x154 + .debug_line.dwo: 0 0x40 + .debug_loc.dwo: 0 0 + .debug_str_offsets.dwo: 0 0x14 <0><b>: Abbrev Number: 12 (DW_TAG_compile_unit) <c> DW_AT_producer : GNU C++ 4.7.x-google 20120720 (prerelease) <37> DW_AT_language : 4 (C++) @@ -30,7 +30,7 @@ Contents of the .debug_info.dwo section: <a5> DW_AT_decl_file : 1 <a6> DW_AT_decl_line : 30 <a7> DW_AT_type : <0x90> - <ab> DW_AT_low_pc : (index: 0x0): 0 + <ab> DW_AT_low_pc : (index: 0): 0 <ac> DW_AT_high_pc : 0x304 <b4> DW_AT_frame_base : 1 byte block: 9c (DW_OP_call_frame_cfa) <b6> DW_AT_GNU_all_tail_call_sites: 1 @@ -121,12 +121,12 @@ Contents of the .debug_info.dwo section: Compilation Unit @ offset 0x17c: Length: 0x5af (32-bit) Version: 4 - Abbrev Offset: 0x0 + Abbrev Offset: 0 Pointer Size: 8 Section contributions: .debug_abbrev.dwo: 0x154 0x21d .debug_line.dwo: 0x40 0x3d - .debug_loc.dwo: 0x0 0x0 + .debug_loc.dwo: 0 0 .debug_str_offsets.dwo: 0x14 0x44 <0><187>: Abbrev Number: 12 (DW_TAG_compile_unit) <188> DW_AT_producer : GNU C++ 4.7.x-google 20120720 (prerelease) @@ -141,7 +141,7 @@ Contents of the .debug_info.dwo section: <215> DW_AT_sibling : <0x242> <2><219>: Abbrev Number: 14 (DW_TAG_subprogram) <21a> DW_AT_external : 1 - <21a> DW_AT_name : (indexed string: 0x0): testcase1 + <21a> DW_AT_name : (indexed string: 0): testcase1 <21b> DW_AT_decl_file : 1 <21c> DW_AT_decl_line : 28 <21d> DW_AT_linkage_name: (indexed string: 0xc): _ZN2C19testcase1Ev @@ -194,7 +194,7 @@ Contents of the .debug_info.dwo section: <267> DW_AT_sibling : <0x294> <2><26b>: Abbrev Number: 14 (DW_TAG_subprogram) <26c> DW_AT_external : 1 - <26c> DW_AT_name : (indexed string: 0x0): testcase1 + <26c> DW_AT_name : (indexed string: 0): testcase1 <26d> DW_AT_decl_file : 1 <26e> DW_AT_decl_line : 40 <26f> DW_AT_linkage_name: (indexed string: 0x7): _ZN2C29testcase1Ev @@ -239,7 +239,7 @@ Contents of the .debug_info.dwo section: <2aa> DW_AT_sibling : <0x2cd> <2><2ae>: Abbrev Number: 14 (DW_TAG_subprogram) <2af> DW_AT_external : 1 - <2af> DW_AT_name : (indexed string: 0x0): testcase1 + <2af> DW_AT_name : (indexed string: 0): testcase1 <2b0> DW_AT_decl_file : 1 <2b1> DW_AT_decl_line : 50 <2b2> DW_AT_linkage_name: (indexed string: 0x2): _ZN2C39testcase1Ev @@ -274,7 +274,7 @@ Contents of the .debug_info.dwo section: <2dd> DW_AT_decl_file : 1 <2de> DW_AT_decl_line : 70 <2df> DW_AT_linkage_name: _Z4f13iv - <2e8> DW_AT_low_pc : (index: 0x0): 0 + <2e8> DW_AT_low_pc : (index: 0): 0 <2e9> DW_AT_high_pc : 0x6 <2f1> DW_AT_frame_base : 1 byte block: 9c (DW_OP_call_frame_cfa) <2f3> DW_AT_GNU_all_call_sites: 1 @@ -758,13 +758,13 @@ Contents of the .debug_info.dwo section: Compilation Unit @ offset 0x72f: Length: 0xcb (32-bit) Version: 4 - Abbrev Offset: 0x0 + Abbrev Offset: 0 Pointer Size: 8 Section contributions: .debug_abbrev.dwo: 0x371 0xbd .debug_line.dwo: 0x7d 0x3e - .debug_loc.dwo: 0x0 0x0 - .debug_str_offsets.dwo: 0x0 0x0 + .debug_loc.dwo: 0 0 + .debug_str_offsets.dwo: 0 0 <0><73a>: Abbrev Number: 10 (DW_TAG_compile_unit) <73b> DW_AT_producer : GNU C++ 4.7.x-google 20120720 (prerelease) <766> DW_AT_language : 4 (C++) @@ -786,7 +786,7 @@ Contents of the .debug_info.dwo section: <7d3> DW_AT_decl_line : 32 <7d4> DW_AT_linkage_name: _Z4t16av <7dd> DW_AT_type : <0x7c4> - <7e1> DW_AT_low_pc : (index: 0x0): 0 + <7e1> DW_AT_low_pc : (index: 0): 0 <7e2> DW_AT_high_pc : 0x13 <7ea> DW_AT_frame_base : 1 byte block: 9c (DW_OP_call_frame_cfa) <7ec> DW_AT_GNU_all_tail_call_sites: 1 @@ -801,12 +801,12 @@ Contents of the .debug_info.dwo section: Compilation Unit @ offset 0x7fe: Length: 0x329 (32-bit) Version: 4 - Abbrev Offset: 0x0 + Abbrev Offset: 0 Pointer Size: 8 Section contributions: .debug_abbrev.dwo: 0x42e 0x1f2 .debug_line.dwo: 0xbb 0x3d - .debug_loc.dwo: 0x0 0x0 + .debug_loc.dwo: 0 0 .debug_str_offsets.dwo: 0x58 0x18 <0><809>: Abbrev Number: 12 (DW_TAG_compile_unit) <80a> DW_AT_producer : GNU C++ 4.7.x-google 20120720 (prerelease) @@ -878,7 +878,7 @@ Contents of the .debug_info.dwo section: <908> DW_AT_decl_file : 1 <909> DW_AT_decl_line : 70 <90a> DW_AT_linkage_name: _Z4f13iv - <913> DW_AT_low_pc : (index: 0x0): 0 + <913> DW_AT_low_pc : (index: 0): 0 <914> DW_AT_high_pc : 0x6 <91c> DW_AT_frame_base : 1 byte block: 9c (DW_OP_call_frame_cfa) <91e> DW_AT_GNU_all_call_sites: 1 @@ -1099,22 +1099,22 @@ Contents of the .debug_info.dwo section: Contents of the .debug_types.dwo section: - Compilation Unit @ offset 0x0: + Compilation Unit @ offset 0: Length: 0xf7 (32-bit) Version: 4 - Abbrev Offset: 0x0 + Abbrev Offset: 0 Pointer Size: 8 Signature: 0xb534bdc1f01629bb Type Offset: 0x25 Section contributions: - .debug_abbrev.dwo: 0x0 0x154 - .debug_line.dwo: 0x0 0x40 - .debug_loc.dwo: 0x0 0x0 - .debug_str_offsets.dwo: 0x0 0x14 + .debug_abbrev.dwo: 0 0x154 + .debug_line.dwo: 0 0x40 + .debug_loc.dwo: 0 0 + .debug_str_offsets.dwo: 0 0x14 <0><17>: Abbrev Number: 1 (DW_TAG_type_unit) <18> DW_AT_language : 4 (C++) <19> DW_AT_GNU_odr_signature: 0x880a5c4d6e59da8a - <21> DW_AT_stmt_list : 0x0 + <21> DW_AT_stmt_list : 0 <1><25>: Abbrev Number: 2 (DW_TAG_class_type) <26> DW_AT_name : C3 <29> DW_AT_byte_size : 4 @@ -1130,7 +1130,7 @@ Contents of the .debug_types.dwo section: <39> DW_AT_accessibility: 1 (public) <2><3a>: Abbrev Number: 4 (DW_TAG_subprogram) <3b> DW_AT_external : 1 - <3b> DW_AT_name : (indexed string: 0x0): testcase1 + <3b> DW_AT_name : (indexed string: 0): testcase1 <3c> DW_AT_decl_file : 2 <3d> DW_AT_decl_line : 50 <3e> DW_AT_linkage_name: _ZN2C39testcase1Ev @@ -1208,19 +1208,19 @@ Contents of the .debug_types.dwo section: Compilation Unit @ offset 0xfb: Length: 0xf1 (32-bit) Version: 4 - Abbrev Offset: 0x0 + Abbrev Offset: 0 Pointer Size: 8 Signature: 0xab98c7bc886f5266 Type Offset: 0x25 Section contributions: - .debug_abbrev.dwo: 0x0 0x154 - .debug_line.dwo: 0x0 0x40 - .debug_loc.dwo: 0x0 0x0 - .debug_str_offsets.dwo: 0x0 0x14 + .debug_abbrev.dwo: 0 0x154 + .debug_line.dwo: 0 0x40 + .debug_loc.dwo: 0 0 + .debug_str_offsets.dwo: 0 0x14 <0><112>: Abbrev Number: 1 (DW_TAG_type_unit) <113> DW_AT_language : 4 (C++) <114> DW_AT_GNU_odr_signature: 0xae4af0d8bfcef94b - <11c> DW_AT_stmt_list : 0x0 + <11c> DW_AT_stmt_list : 0 <1><120>: Abbrev Number: 2 (DW_TAG_class_type) <121> DW_AT_name : C2 <124> DW_AT_byte_size : 4 @@ -1236,7 +1236,7 @@ Contents of the .debug_types.dwo section: <134> DW_AT_accessibility: 1 (public) <2><135>: Abbrev Number: 4 (DW_TAG_subprogram) <136> DW_AT_external : 1 - <136> DW_AT_name : (indexed string: 0x0): testcase1 + <136> DW_AT_name : (indexed string: 0): testcase1 <137> DW_AT_decl_file : 2 <138> DW_AT_decl_line : 40 <139> DW_AT_linkage_name: _ZN2C29testcase1Ev @@ -1309,19 +1309,19 @@ Contents of the .debug_types.dwo section: Compilation Unit @ offset 0x1f0: Length: 0x141 (32-bit) Version: 4 - Abbrev Offset: 0x0 + Abbrev Offset: 0 Pointer Size: 8 Signature: 0xb5faa2a4b7a919c4 Type Offset: 0x25 Section contributions: - .debug_abbrev.dwo: 0x0 0x154 - .debug_line.dwo: 0x0 0x40 - .debug_loc.dwo: 0x0 0x0 - .debug_str_offsets.dwo: 0x0 0x14 + .debug_abbrev.dwo: 0 0x154 + .debug_line.dwo: 0 0x40 + .debug_loc.dwo: 0 0 + .debug_str_offsets.dwo: 0 0x14 <0><207>: Abbrev Number: 1 (DW_TAG_type_unit) <208> DW_AT_language : 4 (C++) <209> DW_AT_GNU_odr_signature: 0xc7fbeb753b05ade3 - <211> DW_AT_stmt_list : 0x0 + <211> DW_AT_stmt_list : 0 <1><215>: Abbrev Number: 2 (DW_TAG_class_type) <216> DW_AT_name : C1 <219> DW_AT_byte_size : 4 @@ -1337,7 +1337,7 @@ Contents of the .debug_types.dwo section: <229> DW_AT_accessibility: 1 (public) <2><22a>: Abbrev Number: 4 (DW_TAG_subprogram) <22b> DW_AT_external : 1 - <22b> DW_AT_name : (indexed string: 0x0): testcase1 + <22b> DW_AT_name : (indexed string: 0): testcase1 <22c> DW_AT_decl_file : 2 <22d> DW_AT_decl_line : 28 <22e> DW_AT_linkage_name: _ZN2C19testcase1Ev diff --git a/gas/testsuite/gas/aarch64/dwarf.d b/gas/testsuite/gas/aarch64/dwarf.d index b0581fbcfa6..9e4184ab6e8 100644 --- a/gas/testsuite/gas/aarch64/dwarf.d +++ b/gas/testsuite/gas/aarch64/dwarf.d @@ -18,11 +18,10 @@ Contents of the .debug_aranges section: Length: (44|28) Version: 2 - Offset into .debug_info: 0x0 + Offset into .debug_info: (0x)?0 Pointer Size: (8|4) Segment Size: 0 Address[ ]+Length - 0+ 0+8[ ]+ - 0+ 0+[ ]+ - + 0+ 0+8 ? + 0+ 0+ ? diff --git a/gas/testsuite/gas/cris/rd-dw2-1.d b/gas/testsuite/gas/cris/rd-dw2-1.d index ee993814a7f..fcf3170c0aa 100644 --- a/gas/testsuite/gas/cris/rd-dw2-1.d +++ b/gas/testsuite/gas/cris/rd-dw2-1.d @@ -4,8 +4,8 @@ # A most simple instruction sequence. #... Line Number Statements: - \[0x.*\] Extended opcode 2: set Address to 0x0 - \[0x.*\] Special opcode .*: advance Address by 0 to 0x0 and Line by 4 to 5 + \[0x.*\] Extended opcode 2: set Address to (0x)?0 + \[0x.*\] Special opcode .*: advance Address by 0 to (0x)?0 and Line by 4 to 5 \[0x.*\] Special opcode .*: advance Address by 2 to 0x2 and Line by 1 to 6 \[0x.*\] Special opcode .*: advance Address by 2 to 0x4 and Line by 1 to 7 \[0x.*\] Special opcode .*: advance Address by 2 to 0x6 and Line by 1 to 8 diff --git a/gas/testsuite/gas/cris/rd-dw2-10.d b/gas/testsuite/gas/cris/rd-dw2-10.d index 115246d30f5..0ca9208b71d 100644 --- a/gas/testsuite/gas/cris/rd-dw2-10.d +++ b/gas/testsuite/gas/cris/rd-dw2-10.d @@ -5,7 +5,7 @@ # Continued line. #... Line Number Statements: - \[0x.*\] Extended opcode 2: set Address to 0x0 - \[0x.*\] Special opcode .*: advance Address by 0 to 0x0 and Line by 6 to 7 + \[0x.*\] Extended opcode 2: set Address to (0x)?0 + \[0x.*\] Special opcode .*: advance Address by 0 to (0x)?0 and Line by 6 to 7 \[0x.*\] Advance PC by 4 to 0x4 \[0x.*\] Extended opcode 1: End of Sequence diff --git a/gas/testsuite/gas/cris/rd-dw2-11.d b/gas/testsuite/gas/cris/rd-dw2-11.d index 147c48c4562..67d57dcb20e 100644 --- a/gas/testsuite/gas/cris/rd-dw2-11.d +++ b/gas/testsuite/gas/cris/rd-dw2-11.d @@ -5,8 +5,8 @@ # Highly "fragmented" code. #... Line Number Statements: - \[0x.*\] Extended opcode 2: set Address to 0x0 - \[0x.*\] Special opcode .*: advance Address by 0 to 0x0 and Line by 4 to 5 + \[0x.*\] Extended opcode 2: set Address to (0x)?0 + \[0x.*\] Special opcode .*: advance Address by 0 to (0x)?0 and Line by 4 to 5 \[0x.*\] Special opcode .*: advance Address by 2 to 0x2 and Line by 1 to 6 \[0x.*\] Advance PC by 126 to 0x80 \[0x.*\] Special opcode .*: advance Address by 0 to 0x80 and Line by 2 to 8 diff --git a/gas/testsuite/gas/cris/rd-dw2-12.d b/gas/testsuite/gas/cris/rd-dw2-12.d index aeb2e322f93..a1c48957e5d 100644 --- a/gas/testsuite/gas/cris/rd-dw2-12.d +++ b/gas/testsuite/gas/cris/rd-dw2-12.d @@ -5,8 +5,8 @@ # Pushes and other prefixes. #... Line Number Statements: - \[0x.*\] Extended opcode 2: set Address to 0x0 - \[0x.*\] Special opcode .*: advance Address by 0 to 0x0 and Line by 4 to 5 + \[0x.*\] Extended opcode 2: set Address to (0x)?0 + \[0x.*\] Special opcode .*: advance Address by 0 to (0x)?0 and Line by 4 to 5 \[0x.*\] Special opcode .*: advance Address by 4 to 0x4 and Line by 1 to 6 \[0x.*\] Special opcode .*: advance Address by 4 to 0x8 and Line by 1 to 7 \[0x.*\] Special opcode .*: advance Address by 4 to 0xc and Line by 2 to 9 diff --git a/gas/testsuite/gas/cris/rd-dw2-13.d b/gas/testsuite/gas/cris/rd-dw2-13.d index 79234e38969..42c9b527577 100644 --- a/gas/testsuite/gas/cris/rd-dw2-13.d +++ b/gas/testsuite/gas/cris/rd-dw2-13.d @@ -5,8 +5,8 @@ # PIC prefix relocs. #... Line Number Statements: - \[0x.*\] Extended opcode 2: set Address to 0x0 - \[0x.*\] Special opcode .*: advance Address by 0 to 0x0 and Line by 5 to 6 + \[0x.*\] Extended opcode 2: set Address to (0x)?0 + \[0x.*\] Special opcode .*: advance Address by 0 to (0x)?0 and Line by 5 to 6 \[0x.*\] Special opcode .*: advance Address by 6 to 0x6 and Line by 1 to 7 \[0x.*\] Special opcode .*: advance Address by 8 to 0xe and Line by 1 to 8 \[0x.*\] Special opcode .*: advance Address by 6 to 0x14 and Line by 1 to 9 diff --git a/gas/testsuite/gas/cris/rd-dw2-14.d b/gas/testsuite/gas/cris/rd-dw2-14.d index d34fa4639c4..dabbc15ede6 100644 --- a/gas/testsuite/gas/cris/rd-dw2-14.d +++ b/gas/testsuite/gas/cris/rd-dw2-14.d @@ -5,8 +5,8 @@ # Prefixes of various sizes. #... Line Number Statements: - \[0x.*\] Extended opcode 2: set Address to 0x0 - \[0x.*\] Special opcode .*: advance Address by 0 to 0x0 and Line by 8 to 9 + \[0x.*\] Extended opcode 2: set Address to (0x)?0 + \[0x.*\] Special opcode .*: advance Address by 0 to (0x)?0 and Line by 8 to 9 \[0x.*\] Special opcode .*: advance Address by 2 to 0x2 and Line by 1 to 10 \[0x.*\] Special opcode .*: advance Address by 4 to 0x6 and Line by 1 to 11 \[0x.*\] Special opcode .*: advance Address by 4 to 0xa and Line by 1 to 12 diff --git a/gas/testsuite/gas/cris/rd-dw2-15.d b/gas/testsuite/gas/cris/rd-dw2-15.d index 361d7fe076c..b4bdd686e85 100644 --- a/gas/testsuite/gas/cris/rd-dw2-15.d +++ b/gas/testsuite/gas/cris/rd-dw2-15.d @@ -5,8 +5,8 @@ # Various prefixes, assembled standalone. #... Line Number Statements: - \[0x.*\] Extended opcode 2: set Address to 0x0 - \[0x.*\] Special opcode .*: advance Address by 0 to 0x0 and Line by 8 to 9 + \[0x.*\] Extended opcode 2: set Address to (0x)?0 + \[0x.*\] Special opcode .*: advance Address by 0 to (0x)?0 and Line by 8 to 9 \[0x.*\] Special opcode .*: advance Address by 2 to 0x2 and Line by 1 to 10 \[0x.*\] Special opcode .*: advance Address by 2 to 0x4 and Line by 2 to 12 \[0x.*\] Special opcode .*: advance Address by 2 to 0x6 and Line by 1 to 13 diff --git a/gas/testsuite/gas/cris/rd-dw2-3.d b/gas/testsuite/gas/cris/rd-dw2-3.d index dadf66c88b5..aec1c7c7c21 100644 --- a/gas/testsuite/gas/cris/rd-dw2-3.d +++ b/gas/testsuite/gas/cris/rd-dw2-3.d @@ -5,8 +5,8 @@ # Simple branch-expansion, type 1. #... Line Number Statements: - \[0x.*\] Extended opcode 2: set Address to 0x0 - \[0x.*\] Special opcode .*: advance Address by 0 to 0x0 and Line by 7 to 8 + \[0x.*\] Extended opcode 2: set Address to (0x)?0 + \[0x.*\] Special opcode .*: advance Address by 0 to (0x)?0 and Line by 7 to 8 \[0x.*\] Special opcode .*: advance Address by 12 to 0xc and Line by 1 to 9 \[0x.*\] Advance PC by 2 to 0xe \[0x.*\] Extended opcode 1: End of Sequence diff --git a/gas/testsuite/gas/cris/rd-dw2-4.d b/gas/testsuite/gas/cris/rd-dw2-4.d index f8fb7b0731f..6614eb6a14c 100644 --- a/gas/testsuite/gas/cris/rd-dw2-4.d +++ b/gas/testsuite/gas/cris/rd-dw2-4.d @@ -5,8 +5,8 @@ # Simple branch-expansion, type 2. #... Line Number Statements: - \[0x.*\] Extended opcode 2: set Address to 0x0 - \[0x.*\] Special opcode .*: advance Address by 0 to 0x0 and Line by 7 to 8 + \[0x.*\] Extended opcode 2: set Address to (0x)?0 + \[0x.*\] Special opcode .*: advance Address by 0 to (0x)?0 and Line by 7 to 8 \[0x.*\] Advance PC by 32780 to 0x800c \[0x.*\] Special opcode .*: advance Address by 0 to 0x800c and Line by 3 to 11 \[0x.*\] Advance PC by 2 to 0x800e diff --git a/gas/testsuite/gas/cris/rd-dw2-5.d b/gas/testsuite/gas/cris/rd-dw2-5.d index ee4c6ffa014..e9664f10856 100644 --- a/gas/testsuite/gas/cris/rd-dw2-5.d +++ b/gas/testsuite/gas/cris/rd-dw2-5.d @@ -5,8 +5,8 @@ # Simple branch-expansion, type 3. #... Line Number Statements: - \[0x.*\] Extended opcode 2: set Address to 0x0 - \[0x.*\] Special opcode .*: advance Address by 0 to 0x0 and Line by 7 to 8 + \[0x.*\] Extended opcode 2: set Address to (0x)?0 + \[0x.*\] Special opcode .*: advance Address by 0 to (0x)?0 and Line by 7 to 8 \[0x.*\] Advance PC by 32770 to 0x8002 \[0x.*\] Special opcode .*: advance Address by 0 to 0x8002 and Line by 2 to 10 \[0x.*\] Special opcode .*: advance Address by 12 to 0x800e and Line by 1 to 11 diff --git a/gas/testsuite/gas/cris/rd-dw2-6.d b/gas/testsuite/gas/cris/rd-dw2-6.d index 0771ac086f4..1c2051bdcb6 100644 --- a/gas/testsuite/gas/cris/rd-dw2-6.d +++ b/gas/testsuite/gas/cris/rd-dw2-6.d @@ -5,8 +5,8 @@ # Complicated branch expansion. #... Line Number Statements: - \[0x.*\] Extended opcode 2: set Address to 0x0 - \[0x.*\] Special opcode .*: advance Address by 0 to 0x0 and Line by 7 to 8 + \[0x.*\] Extended opcode 2: set Address to (0x)?0 + \[0x.*\] Special opcode .*: advance Address by 0 to (0x)?0 and Line by 7 to 8 \[0x.*\] Special opcode .*: advance Address by 2 to 0x2 and Line by 2 to 10 \[0x.*\] Advance PC by 32360 to 0x7e6a \[0x.*\] Special opcode .*: advance Address by 0 to 0x7e6a and Line by 3 to 13 diff --git a/gas/testsuite/gas/cris/rd-dw2-7.d b/gas/testsuite/gas/cris/rd-dw2-7.d index c62fae83100..d463ebb2acf 100644 --- a/gas/testsuite/gas/cris/rd-dw2-7.d +++ b/gas/testsuite/gas/cris/rd-dw2-7.d @@ -5,8 +5,8 @@ # Most simple broken word. #... Line Number Statements: - \[0x.*\] Extended opcode 2: set Address to 0x0 - \[0x.*\] Special opcode .*: advance Address by 0 to 0x0 and Line by 2 to 3 + \[0x.*\] Extended opcode 2: set Address to (0x)?0 + \[0x.*\] Special opcode .*: advance Address by 0 to (0x)?0 and Line by 2 to 3 \[0x.*\] Special opcode .*: advance Address by 4 to 0x4 and Line by 4 to 7 \[0x.*\] Special opcode .*: advance Address by 14 to 0x12 and Line by 8 to 15 \[0x.*\] Advance PC by 32768 to 0x8012 diff --git a/gas/testsuite/gas/cris/rd-dw2-8.d b/gas/testsuite/gas/cris/rd-dw2-8.d index fb08aa7051e..a50de2fb925 100644 --- a/gas/testsuite/gas/cris/rd-dw2-8.d +++ b/gas/testsuite/gas/cris/rd-dw2-8.d @@ -5,8 +5,8 @@ # Simple broken word, table with two labels. #... Line Number Statements: - \[0x.*\] Extended opcode 2: set Address to 0x0 - \[0x.*\] Special opcode .*: advance Address by 0 to 0x0 and Line by 2 to 3 + \[0x.*\] Extended opcode 2: set Address to (0x)?0 + \[0x.*\] Special opcode .*: advance Address by 0 to (0x)?0 and Line by 2 to 3 \[0x.*\] Special opcode .*: advance Address by 6 to 0x6 and Line by 5 to 8 \[0x.*\] Advance Line by 9 to 17 \[0x.*\] Special opcode .*: advance Address by 20 to 0x1a and Line by 0 to 17 diff --git a/gas/testsuite/gas/cris/rd-dw2-9.d b/gas/testsuite/gas/cris/rd-dw2-9.d index a83d89feac9..0f2a12c4667 100644 --- a/gas/testsuite/gas/cris/rd-dw2-9.d +++ b/gas/testsuite/gas/cris/rd-dw2-9.d @@ -5,8 +5,8 @@ # Long broken word table. #... Line Number Statements: - \[0x.*\] Extended opcode 2: set Address to 0x0 - \[0x.*\] Special opcode .*: advance Address by 0 to 0x0 and Line by 3 to 4 + \[0x.*\] Extended opcode 2: set Address to (0x)?0 + \[0x.*\] Special opcode .*: advance Address by 0 to (0x)?0 and Line by 3 to 4 \[0x.*\] Special opcode .*: advance Address by 2 to 0x2 and Line by 4 to 8 \[0x.*\] Special opcode .*: advance Address by 4 to 0x6 and Line by 1 to 9 \[0x.*\] Special opcode .*: advance Address by 4 to 0xa and Line by 1 to 10 diff --git a/gas/testsuite/gas/elf/dwarf-3-func.d b/gas/testsuite/gas/elf/dwarf-3-func.d index 0196f69e2ed..e17dff27dd0 100644 --- a/gas/testsuite/gas/elf/dwarf-3-func.d +++ b/gas/testsuite/gas/elf/dwarf-3-func.d @@ -36,7 +36,7 @@ Contents of the .debug_info section: Contents of the .debug_abbrev section: - +Number TAG \(0x0\) + +Number TAG \((0x)?0\) +1 +DW_TAG_compile_unit +\[has children\] #... +2 +DW_TAG_subprogram +\[no children\] diff --git a/gas/testsuite/gas/elf/dwarf-4-cu.d b/gas/testsuite/gas/elf/dwarf-4-cu.d index 85a07390d38..8fc901d7d09 100644 --- a/gas/testsuite/gas/elf/dwarf-4-cu.d +++ b/gas/testsuite/gas/elf/dwarf-4-cu.d @@ -3,9 +3,9 @@ #readelf: -wi #... - Compilation Unit @ offset 0x0: + Compilation Unit @ offset (0x)?0: Length: 0x.* Version: 4 - Abbrev Offset: 0x0 + Abbrev Offset: (0x)?0 Pointer Size: . #pass diff --git a/gas/testsuite/gas/elf/dwarf-5-cu.d b/gas/testsuite/gas/elf/dwarf-5-cu.d index 7db20a330b8..fe305ea7a34 100644 --- a/gas/testsuite/gas/elf/dwarf-5-cu.d +++ b/gas/testsuite/gas/elf/dwarf-5-cu.d @@ -3,10 +3,10 @@ #readelf: -wi #... - Compilation Unit @ offset 0x0: + Compilation Unit @ offset (0x)?0: Length: 0x.* Version: 5 Unit Type: DW_UT_compile \(1\) - Abbrev Offset: 0x0 + Abbrev Offset: (0x)?0 Pointer Size: . #pass diff --git a/gas/testsuite/gas/elf/dwarf-5-dir0.d b/gas/testsuite/gas/elf/dwarf-5-dir0.d index 7a8361ea5d2..bf85202c6d5 100644 --- a/gas/testsuite/gas/elf/dwarf-5-dir0.d +++ b/gas/testsuite/gas/elf/dwarf-5-dir0.d @@ -5,15 +5,15 @@ #... The Directory Table \(offset 0x.*, lines 4, columns 1\): Entry Name - 0 \(indirect line string, offset: 0x0\): .*/gas/testsuite + 0 \(indirect line string, offset: (0x)?0\): .*/gas/testsuite 1 \(indirect line string, offset: 0x.*\): ../not-the-build-directory 2 \(indirect line string, offset: 0x.*\): secondary directory 3 \(indirect line string, offset: 0x.*\): /tmp The File Name Table \(offset 0x.*, lines 3, columns 3\): Entry Dir MD5 Name - 0 1 0x0 \(indirect line string, offset: 0x.*\): master-source-file.c - 1 2 0x0 \(indirect line string, offset: 0x.*\): secondary source file + 0 1 (0x)?0 \(indirect line string, offset: 0x.*\): master-source-file.c + 1 2 (0x)?0 \(indirect line string, offset: 0x.*\): secondary source file 2 3 0x95828e8bc4f7404dbf7526fb7bd0f192 \(indirect line string, offset: 0x.*\): foo.c #pass diff --git a/gas/testsuite/gas/elf/dwarf-5-file0.d b/gas/testsuite/gas/elf/dwarf-5-file0.d index 2502b80d1f9..c978b79a530 100644 --- a/gas/testsuite/gas/elf/dwarf-5-file0.d +++ b/gas/testsuite/gas/elf/dwarf-5-file0.d @@ -12,8 +12,8 @@ The File Name Table \(offset 0x.*, lines 3, columns 3\): Entry Dir MD5 Name - 0 1 0x0 \(indirect line string, offset: 0x.*\): master source file - 1 2 0x0 \(indirect line string, offset: 0x.*\): secondary source file + 0 1 (0x)?0 \(indirect line string, offset: 0x.*\): master source file + 1 2 (0x)?0 \(indirect line string, offset: 0x.*\): secondary source file 2 3 0x95828e8bc4f7404dbf7526fb7bd0f192 \(indirect line string, offset: 0x.*\): foo.c #pass diff --git a/gas/testsuite/gas/elf/dwarf-5-func-global.d b/gas/testsuite/gas/elf/dwarf-5-func-global.d index 09b10fdf744..03c425dcc8b 100644 --- a/gas/testsuite/gas/elf/dwarf-5-func-global.d +++ b/gas/testsuite/gas/elf/dwarf-5-func-global.d @@ -28,7 +28,7 @@ Contents of the .debug_info section: Contents of the .debug_abbrev s[...] [diff truncated at 100000 bytes]
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=31e5a3a3807e7d5b43845d0d17ddfd1a8692752c commit 31e5a3a3807e7d5b43845d0d17ddfd1a8692752c Author: Alan Modra <amodra@gmail.com> Date: Fri Aug 12 17:47:51 2022 +0930 Make dwarf_vma uint64_t This replaces dwarf_vma, dwarf_size_type and dwarf_signed_vma with uint64_t and int64_t everywhere. The patch also gets rid of DWARF_VMA_FMT since we can't use that with uint64_t, and all of the configure support for deciding the flavour of HOST_WIDEST_INT. dwarf_vmatoa also disappears, replacing most uses with one of PRIx64, PRId64 or PRIu64. Printing of size_t and ptrdiff_t values now use %z and %t rather than by casting to unsigned long. Also, most warning messages that used 0x%lx or similar now use %#lx and a few that didn't print the 0x hex prefix now also use %#. The patch doesn't change normal readelf output, except in odd cases where values previously might have been truncated. Diff: --- binutils/config.in | 6 - binutils/configure | 254 +------ binutils/configure.ac | 3 - binutils/dwarf.c | 1864 +++++++++++++++++++++++-------------------------- binutils/dwarf.h | 56 +- binutils/objdump.c | 2 +- binutils/readelf.c | 40 +- binutils/sysdep.h | 8 - 8 files changed, 931 insertions(+), 1302 deletions(-) diff --git a/binutils/config.in b/binutils/config.in index 131f09b4212..c5fb919aa95 100644 --- a/binutils/config.in +++ b/binutils/config.in @@ -185,12 +185,6 @@ /* Define to the version of this package. */ #undef PACKAGE_VERSION -/* The size of `long', as computed by sizeof. */ -#undef SIZEOF_LONG - -/* The size of `long long', as computed by sizeof. */ -#undef SIZEOF_LONG_LONG - /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS diff --git a/binutils/configure b/binutils/configure index ddb3020b3c9..542c832be18 100755 --- a/binutils/configure +++ b/binutils/configure @@ -1980,189 +1980,6 @@ $as_echo "$ac_res" >&6; } } # ac_fn_c_check_func -# ac_fn_c_compute_int LINENO EXPR VAR INCLUDES -# -------------------------------------------- -# Tries to find the compile-time value of EXPR in a program that includes -# INCLUDES, setting VAR accordingly. Returns whether the value could be -# computed -ac_fn_c_compute_int () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if test "$cross_compiling" = yes; then - # Depending upon the size, compute the lo and hi bounds. -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -static int test_array [1 - 2 * !(($2) >= 0)]; -test_array [0] = 0; -return test_array [0]; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_lo=0 ac_mid=0 - while :; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -static int test_array [1 - 2 * !(($2) <= $ac_mid)]; -test_array [0] = 0; -return test_array [0]; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_hi=$ac_mid; break -else - as_fn_arith $ac_mid + 1 && ac_lo=$as_val - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -static int test_array [1 - 2 * !(($2) < 0)]; -test_array [0] = 0; -return test_array [0]; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_hi=-1 ac_mid=-1 - while :; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -static int test_array [1 - 2 * !(($2) >= $ac_mid)]; -test_array [0] = 0; -return test_array [0]; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_lo=$ac_mid; break -else - as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done -else - ac_lo= ac_hi= -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -# Binary search between lo and hi bounds. -while test "x$ac_lo" != "x$ac_hi"; do - as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -static int test_array [1 - 2 * !(($2) <= $ac_mid)]; -test_array [0] = 0; -return test_array [0]; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_hi=$ac_mid -else - as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -done -case $ac_lo in #(( -?*) eval "$3=\$ac_lo"; ac_retval=0 ;; -'') ac_retval=1 ;; -esac - else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -static long int longval () { return $2; } -static unsigned long int ulongval () { return $2; } -#include <stdio.h> -#include <stdlib.h> -int -main () -{ - - FILE *f = fopen ("conftest.val", "w"); - if (! f) - return 1; - if (($2) < 0) - { - long int i = longval (); - if (i != ($2)) - return 1; - fprintf (f, "%ld", i); - } - else - { - unsigned long int i = ulongval (); - if (i != ($2)) - return 1; - fprintf (f, "%lu", i); - } - /* Do not output a trailing newline, as this causes \r\n confusion - on some platforms. */ - return ferror (f) || fclose (f) != 0; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - echo >>conftest.val; read $3 <conftest.val; ac_retval=0 -else - ac_retval=1 -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -rm -f conftest.val - - fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_compute_int - # ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES # ---------------------------------------------------- # Tries to find if the field MEMBER exists in type AGGR, after including @@ -10987,7 +10804,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 10990 "configure" +#line 10807 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11093,7 +10910,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11096 "configure" +#line 10913 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -13024,73 +12841,6 @@ case "${host}" in esac -# The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5 -$as_echo_n "checking size of long... " >&6; } -if ${ac_cv_sizeof_long+:} false; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default"; then : - -else - if test "$ac_cv_type_long" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "cannot compute sizeof (long) -See \`config.log' for more details" "$LINENO" 5; } - else - ac_cv_sizeof_long=0 - fi -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5 -$as_echo "$ac_cv_sizeof_long" >&6; } - - - -cat >>confdefs.h <<_ACEOF -#define SIZEOF_LONG $ac_cv_sizeof_long -_ACEOF - - -# The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long long" >&5 -$as_echo_n "checking size of long long... " >&6; } -if ${ac_cv_sizeof_long_long+:} false; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long long))" "ac_cv_sizeof_long_long" "$ac_includes_default"; then : - -else - if test "$ac_cv_type_long_long" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "cannot compute sizeof (long long) -See \`config.log' for more details" "$LINENO" 5; } - else - ac_cv_sizeof_long_long=0 - fi -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_long" >&5 -$as_echo "$ac_cv_sizeof_long_long" >&6; } - - - -cat >>confdefs.h <<_ACEOF -#define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long -_ACEOF - - - # We use headers from include/ that check various HAVE_*_H macros, thus # should ensure they are set by configure. This is true even when C99 # guarantees they are available. diff --git a/binutils/configure.ac b/binutils/configure.ac index 50dac4ee8f4..ec002d3f88f 100644 --- a/binutils/configure.ac +++ b/binutils/configure.ac @@ -174,9 +174,6 @@ case "${host}" in esac AC_SUBST(DEMANGLER_NAME) -AC_CHECK_SIZEOF([long]) -AC_CHECK_SIZEOF([long long]) - # We use headers from include/ that check various HAVE_*_H macros, thus # should ensure they are set by configure. This is true even when C99 # guarantees they are available. diff --git a/binutils/dwarf.c b/binutils/dwarf.c index fdbe1280ac6..a20d546e210 100644 --- a/binutils/dwarf.c +++ b/binutils/dwarf.c @@ -76,7 +76,7 @@ typedef struct dwo_info { dwo_type type; const char * value; - dwarf_vma cu_offset; + uint64_t cu_offset; struct dwo_info * next; } dwo_info; @@ -119,10 +119,6 @@ unsigned long dwarf_start_die; int dwarf_check = 0; -/* Convenient constant, to avoid having to cast -1 to dwarf_vma when - testing whether e.g. a locview list is present. */ -static const dwarf_vma vm1 = -1; - /* Collection of CU/TU section sets from .debug_cu_index and .debug_tu_index sections. For version 1 package files, each set is stored in SHNDX_POOL as a zero-terminated list of section indexes comprising one set of debug @@ -140,9 +136,9 @@ static unsigned int shndx_pool_used = 0; struct cu_tu_set { - uint64_t signature; - dwarf_vma section_offsets[DW_SECT_MAX]; - size_t section_sizes[DW_SECT_MAX]; + uint64_t signature; + uint64_t section_offsets[DW_SECT_MAX]; + size_t section_sizes[DW_SECT_MAX]; }; static int cu_count = 0; @@ -175,7 +171,7 @@ size_of_encoded_value (int encoding) } } -static dwarf_vma +static uint64_t get_encoded_value (unsigned char **pdata, int encoding, struct dwarf_section *section, @@ -183,7 +179,7 @@ get_encoded_value (unsigned char **pdata, { unsigned char * data = * pdata; unsigned int size = size_of_encoded_value (encoding); - dwarf_vma val; + uint64_t val; if (data >= end || size > (size_t) (end - data)) { @@ -220,98 +216,43 @@ get_encoded_value (unsigned char **pdata, return val; } -#if SIZEOF_LONG_LONG > SIZEOF_LONG -# ifndef __MINGW32__ -# define DWARF_VMA_FMT "ll" -# define DWARF_VMA_FMT_LONG "%16.16llx" -# else -# define DWARF_VMA_FMT "I64" -# define DWARF_VMA_FMT_LONG "%016I64x" -# endif -#else -# define DWARF_VMA_FMT "l" -# define DWARF_VMA_FMT_LONG "%16.16lx" -#endif - -/* Convert a dwarf vma value into a string. Returns a pointer to a static - buffer containing the converted VALUE. The value is converted according - to the printf formating character FMTCH. If NUM_BYTES is non-zero then - it specifies the maximum number of bytes to be displayed in the converted - value and FMTCH is ignored - hex is always used. */ +/* Print a uint64_t value (typically an address, offset or length) in + hexadecimal format, followed by a space. The precision displayed is + determined by the NUM_BYTES parameter. */ -static const char * -dwarf_vmatoa_1 (const char *fmtch, dwarf_vma value, unsigned num_bytes) +static void +print_hex (uint64_t value, unsigned num_bytes) { - /* As dwarf_vmatoa is used more then once in a printf call - for output, we are cycling through a fixed array of pointers - for return address. */ - static int buf_pos = 0; - static struct dwarf_vmatoa_buf - { - char place[64]; - } buf[16]; - char *ret; - - ret = buf[buf_pos++].place; - buf_pos %= ARRAY_SIZE (buf); - - if (num_bytes) - { - /* Printf does not have a way of specifying a maximum field width for an - integer value, so we print the full value into a buffer and then select - the precision we need. */ - snprintf (ret, sizeof (buf[0].place), DWARF_VMA_FMT_LONG, value); - if (num_bytes > 8) - num_bytes = 8; - return ret + (16 - 2 * num_bytes); - } - else - { - char fmt[32]; + if (num_bytes == 0) + num_bytes = 2; - if (fmtch) - sprintf (fmt, "%%%s%s", DWARF_VMA_FMT, fmtch); - else - sprintf (fmt, "%%%s", DWARF_VMA_FMT); - snprintf (ret, sizeof (buf[0].place), fmt, value); - return ret; - } -} - -static inline const char * -dwarf_vmatoa (const char * fmtch, dwarf_vma value) -{ - return dwarf_vmatoa_1 (fmtch, value, 0); + printf ("%0*" PRIx64 " ", num_bytes * 2, + value & ~(~(uint64_t) 0 << num_bytes * 4 << num_bytes * 4)); } -/* Print a dwarf_vma value (typically an address, offset or length) in - hexadecimal format, followed by a space. The length of the VALUE (and - hence the precision displayed) is determined by the NUM_BYTES parameter. */ +/* Like print_hex, but no trailing space. */ static void -print_dwarf_vma (dwarf_vma value, unsigned num_bytes) +print_hex_ns (uint64_t value, unsigned num_bytes) { - printf ("%s ", dwarf_vmatoa_1 (NULL, value, num_bytes)); + if (num_bytes == 0) + num_bytes = 2; + + printf ("%0*" PRIx64, num_bytes * 2, + value & ~(~(uint64_t) 0 << num_bytes * 4 << num_bytes * 4)); } -/* Print a view number in hexadecimal value, with the same width - print_dwarf_vma would have printed it with the same num_bytes. - Print blanks for zero view, unless force is nonzero. */ +/* Print a view number in hexadecimal value, with the same width as + print_hex would have printed it. */ static void -print_dwarf_view (dwarf_vma value, unsigned num_bytes, int force) +print_view (uint64_t value, unsigned num_bytes) { - int len; - if (!num_bytes) - len = 4; - else - len = num_bytes * 2; + if (num_bytes == 0) + num_bytes = 2; - assert (value == (unsigned long) value); - if (value || force) - printf ("v%0*lx ", len - 1, (unsigned long) value); - else - printf ("%*s", len + 1, ""); + printf ("v%0*" PRIx64 " ", num_bytes * 2 - 1, + value & ~(~(uint64_t) 0 << num_bytes * 4 << num_bytes * 4)); } /* Read in a LEB128 encoded value starting at address DATA. @@ -319,17 +260,17 @@ print_dwarf_view (dwarf_vma value, unsigned num_bytes, int force) If LENGTH_RETURN is not NULL, return in it the number of bytes read. If STATUS_RETURN is not NULL, return with bit 0 (LSB) set if the terminating byte was not found and with bit 1 set if the value - overflows a dwarf_vma. + overflows a uint64_t. No bytes will be read at address END or beyond. */ -dwarf_vma +uint64_t read_leb128 (unsigned char *data, const unsigned char *const end, bool sign, unsigned int *length_return, int *status_return) { - dwarf_vma result = 0; + uint64_t result = 0; unsigned int num_read = 0; unsigned int shift = 0; int status = 1; @@ -343,11 +284,11 @@ read_leb128 (unsigned char *data, if (shift < CHAR_BIT * sizeof (result)) { - result |= ((dwarf_vma) (byte & 0x7f)) << shift; + result |= ((uint64_t) (byte & 0x7f)) << shift; /* These bits overflowed. */ lost = byte ^ (result >> shift); /* And this is the mask of possible overflow bits. */ - mask = 0x7f ^ ((dwarf_vma) 0x7f << shift >> shift); + mask = 0x7f ^ ((uint64_t) 0x7f << shift >> shift); shift += 7; } else @@ -355,14 +296,14 @@ read_leb128 (unsigned char *data, lost = byte; mask = 0x7f; } - if ((lost & mask) != (sign && (dwarf_signed_vma) result < 0 ? mask : 0)) + if ((lost & mask) != (sign && (int64_t) result < 0 ? mask : 0)) status |= 2; if ((byte & 0x80) == 0) { status &= ~1; if (sign && shift < CHAR_BIT * sizeof (result) && (byte & 0x40)) - result |= -((dwarf_vma) 1 << shift); + result |= -((uint64_t) 1 << shift); break; } } @@ -427,7 +368,7 @@ read_leb128 (unsigned char *data, typedef struct State_Machine_Registers { - dwarf_vma address; + uint64_t address; unsigned int view; unsigned int file; unsigned int line; @@ -470,7 +411,7 @@ process_extended_line_op (unsigned char * data, size_t len, header_len; unsigned char *name; unsigned char *orig_data = data; - dwarf_vma adr, val; + uint64_t adr, val; READ_ULEB (len, data, end); header_len = data - orig_data; @@ -496,13 +437,13 @@ process_extended_line_op (unsigned char * data, /* PR 17512: file: 002-100480-0.004. */ if (len - 1 > 8) { - warn (_("Length (%lu) of DW_LNE_set_address op is too long\n"), - (unsigned long) len - 1); + warn (_("Length (%zu) of DW_LNE_set_address op is too long\n"), + len - 1); adr = 0; } else SAFE_BYTE_GET (adr, data, len - 1, end); - printf (_("set Address to 0x%s\n"), dwarf_vmatoa ("x", adr)); + printf (_("set Address to 0x%" PRIx64 "\n"), adr); state_machine_regs.address = adr; state_machine_regs.view = 0; state_machine_regs.op_index = 0; @@ -522,11 +463,11 @@ process_extended_line_op (unsigned char * data, if (data < end) data++; READ_ULEB (val, data, end); - printf ("%s\t", dwarf_vmatoa ("u", val)); + printf ("%" PRIu64 "\t", val); READ_ULEB (val, data, end); - printf ("%s\t", dwarf_vmatoa ("u", val)); + printf ("%" PRIu64 "\t", val); READ_ULEB (val, data, end); - printf ("%s\t", dwarf_vmatoa ("u", val)); + printf ("%" PRIu64 "\t", val); printf ("%.*s\n\n", (int) l, name); } @@ -536,7 +477,7 @@ process_extended_line_op (unsigned char * data, case DW_LNE_set_discriminator: READ_ULEB (val, data, end); - printf (_("set Discriminator to %s\n"), dwarf_vmatoa ("u", val)); + printf (_("set Discriminator to %" PRIu64 "\n"), val); break; /* HP extensions. */ @@ -589,17 +530,17 @@ process_extended_line_op (unsigned char * data, break; case DW_LNE_HP_SFC_set_listing_line: READ_ULEB (val, data, edata); - printf (" DW_LNE_HP_SFC_set_listing_line (%s)\n", - dwarf_vmatoa ("u", val)); + printf (" DW_LNE_HP_SFC_set_listing_line (%" PRIu64 ")\n", + val); break; case DW_LNE_HP_SFC_associate: printf (" DW_LNE_HP_SFC_associate "); READ_ULEB (val, data, edata); - printf ("(%s", dwarf_vmatoa ("u", val)); + printf ("(%" PRIu64 , val); READ_ULEB (val, data, edata); - printf (",%s", dwarf_vmatoa ("u", val)); + printf (",%" PRIu64, val); READ_ULEB (val, data, edata); - printf (",%s)\n", dwarf_vmatoa ("u", val)); + printf (",%" PRIu64 ")\n", val); break; default: printf (_(" UNKNOWN DW_LNE_HP_SFC opcode (%u)\n"), opc); @@ -634,7 +575,7 @@ process_extended_line_op (unsigned char * data, } static const unsigned char * -fetch_indirect_string (dwarf_vma offset) +fetch_indirect_string (uint64_t offset) { struct dwarf_section *section = &debug_displays [str].section; const unsigned char * ret; @@ -644,8 +585,7 @@ fetch_indirect_string (dwarf_vma offset) if (offset >= section->size) { - warn (_("DW_FORM_strp offset too big: 0x%s\n"), - dwarf_vmatoa ("x", offset)); + warn (_("DW_FORM_strp offset too big: %#" PRIx64 "\n"), offset); return (const unsigned char *) _("<offset is too big>"); } @@ -662,7 +602,7 @@ fetch_indirect_string (dwarf_vma offset) } static const unsigned char * -fetch_indirect_line_string (dwarf_vma offset) +fetch_indirect_line_string (uint64_t offset) { struct dwarf_section *section = &debug_displays [line_str].section; const unsigned char * ret; @@ -672,8 +612,7 @@ fetch_indirect_line_string (dwarf_vma offset) if (offset >= section->size) { - warn (_("DW_FORM_line_strp offset too big: 0x%s\n"), - dwarf_vmatoa ("x", offset)); + warn (_("DW_FORM_line_strp offset too big: %#" PRIx64 "\n"), offset); return (const unsigned char *) _("<offset is too big>"); } @@ -690,18 +629,18 @@ fetch_indirect_line_string (dwarf_vma offset) } static const char * -fetch_indexed_string (dwarf_vma idx, - struct cu_tu_set * this_set, - dwarf_vma offset_size, - bool dwo, - dwarf_vma str_offsets_base) +fetch_indexed_string (uint64_t idx, + struct cu_tu_set *this_set, + uint64_t offset_size, + bool dwo, + uint64_t str_offsets_base) { enum dwarf_section_display_enum str_sec_idx = dwo ? str_dwo : str; enum dwarf_section_display_enum idx_sec_idx = dwo ? str_index_dwo : str_index; struct dwarf_section *index_section = &debug_displays [idx_sec_idx].section; struct dwarf_section *str_section = &debug_displays [str_sec_idx].section; - dwarf_vma index_offset; - dwarf_vma str_offset; + uint64_t index_offset; + uint64_t str_offset; const char * ret; if (index_section->start == NULL) @@ -721,10 +660,9 @@ fetch_indexed_string (dwarf_vma idx, if (index_offset + offset_size > index_section->size) { - warn (_("string index of %s converts to an offset of 0x%s which is too big for section %s"), - dwarf_vmatoa ("d", idx), - dwarf_vmatoa ("x", index_offset), - str_section->name); + warn (_("string index of %" PRIu64 " converts to an offset of %#" PRIx64 + " which is too big for section %s"), + idx, index_offset, str_section->name); return _("<string index too big>"); } @@ -739,8 +677,7 @@ fetch_indexed_string (dwarf_vma idx, str_offset -= str_section->address; if (str_offset >= str_section->size) { - warn (_("indirect offset too big: 0x%s\n"), - dwarf_vmatoa ("x", str_offset)); + warn (_("indirect offset too big: %#" PRIx64 "\n"), str_offset); return _("<indirect index offset is too big>"); } @@ -756,8 +693,8 @@ fetch_indexed_string (dwarf_vma idx, return ret; } -static dwarf_vma -fetch_indexed_addr (dwarf_vma offset, uint32_t num_bytes) +static uint64_t +fetch_indexed_addr (uint64_t offset, uint32_t num_bytes) { struct dwarf_section *section = &debug_displays [debug_addr].section; @@ -769,8 +706,8 @@ fetch_indexed_addr (dwarf_vma offset, uint32_t num_bytes) if (offset + num_bytes > section->size) { - warn (_("Offset into section %s too big: 0x%s\n"), - section->name, dwarf_vmatoa ("x", offset)); + warn (_("Offset into section %s too big: %#" PRIx64 "\n"), + section->name, offset); return 0; } @@ -781,10 +718,10 @@ fetch_indexed_addr (dwarf_vma offset, uint32_t num_bytes) something in another section (eg DW_FORM_loclistx or DW_FORM_rnglistx). Returns -1 if the value could not be found. */ -static dwarf_vma -fetch_indexed_value (dwarf_vma idx, +static uint64_t +fetch_indexed_value (uint64_t idx, enum dwarf_section_display_enum sec_enum, - dwarf_vma base_address) + uint64_t base_address) { struct dwarf_section *section = &debug_displays [sec_enum].section; @@ -807,7 +744,7 @@ fetch_indexed_value (dwarf_vma idx, bias = 12; } - dwarf_vma offset = idx * pointer_size; + uint64_t offset = idx * pointer_size; /* Offsets are biased by the size of the section header or base address. */ @@ -818,8 +755,8 @@ fetch_indexed_value (dwarf_vma idx, if (offset + pointer_size > section->size) { - warn (_("Offset into section %s too big: 0x%s\n"), - section->name, dwarf_vmatoa ("x", offset)); + warn (_("Offset into section %s too big: %#" PRIx64 "\n"), + section->name, offset); return -1; } @@ -832,10 +769,10 @@ fetch_indexed_value (dwarf_vma idx, /* Records a single attribute in an abbrev. */ typedef struct abbrev_attr { - unsigned long attribute; - unsigned long form; - dwarf_signed_vma implicit_const; - struct abbrev_attr * next; + unsigned long attribute; + unsigned long form; + int64_t implicit_const; + struct abbrev_attr *next; } abbrev_attr; @@ -867,9 +804,9 @@ static struct abbrev_list * abbrev_lists = NULL; typedef struct abbrev_map { - dwarf_vma start; - dwarf_vma end; - abbrev_list * list; + uint64_t start; + uint64_t end; + abbrev_list *list; } abbrev_map; /* Maps between CU offsets and abbrev sets. */ @@ -881,7 +818,7 @@ static unsigned long next_free_abbrev_map_entry = 0; #define ABBREV_MAP_ENTRIES_INCREMENT 8 static void -record_abbrev_list_for_cu (dwarf_vma start, dwarf_vma end, +record_abbrev_list_for_cu (uint64_t start, uint64_t end, abbrev_list *list, abbrev_list *free_list) { if (free_list != NULL) @@ -962,7 +899,7 @@ find_abbrev_list_by_raw_abbrev (unsigned char *raw) Not caching abbrevs is likely the answer. */ static abbrev_map * -find_abbrev_map_by_offset (dwarf_vma offset) +find_abbrev_map_by_offset (uint64_t offset) { unsigned long i; @@ -1002,10 +939,10 @@ add_abbrev (unsigned long number, } static void -add_abbrev_attr (unsigned long attribute, - unsigned long form, - dwarf_signed_vma implicit_const, - abbrev_list * list) +add_abbrev_attr (unsigned long attribute, + unsigned long form, + int64_t implicit_const, + abbrev_list *list) { abbrev_attr *attr; @@ -1073,7 +1010,7 @@ process_abbrev_set (struct dwarf_section *section, { unsigned long form; /* Initialize it due to a false compiler warning. */ - dwarf_signed_vma implicit_const = -1; + int64_t implicit_const = -1; READ_ULEB (attribute, start, end); if (start == end) @@ -1112,9 +1049,9 @@ process_abbrev_set (struct dwarf_section *section, static abbrev_list * find_and_process_abbrev_set (struct dwarf_section *section, - dwarf_vma abbrev_base, - dwarf_vma abbrev_size, - dwarf_vma abbrev_offset, + uint64_t abbrev_base, + uint64_t abbrev_size, + uint64_t abbrev_offset, abbrev_list **free_list) { if (free_list) @@ -1124,18 +1061,16 @@ find_and_process_abbrev_set (struct dwarf_section *section, || abbrev_size > section->size - abbrev_base) { /* PR 17531: file:4bcd9ce9. */ - warn (_("Debug info is corrupted, abbrev size (%lx) is larger than " - "abbrev section size (%lx)\n"), - (unsigned long) (abbrev_base + abbrev_size), - (unsigned long) section->size); + warn (_("Debug info is corrupted, abbrev size (%#" PRIx64 ")" + " is larger than abbrev section size (%#" PRIx64 ")\n"), + abbrev_base + abbrev_size, section->size); return NULL; } if (abbrev_offset >= abbrev_size) { - warn (_("Debug info is corrupted, abbrev offset (%lx) is larger than " - "abbrev section size (%lx)\n"), - (unsigned long) abbrev_offset, - (unsigned long) abbrev_size); + warn (_("Debug info is corrupted, abbrev offset (%#" PRIx64 ")" + " is larger than abbrev section size (%#" PRIx64 ")\n"), + abbrev_offset, abbrev_size); return NULL; } @@ -1154,18 +1089,22 @@ find_and_process_abbrev_set (struct dwarf_section *section, } static const char * -get_TAG_name (unsigned long tag) +get_TAG_name (uint64_t tag) { - const char *name = get_DW_TAG_name ((unsigned int) tag); + const char *name = NULL; + if ((unsigned int) tag == tag) + name = get_DW_TAG_name ((unsigned int) tag); if (name == NULL) { static char buffer[100]; if (tag >= DW_TAG_lo_user && tag <= DW_TAG_hi_user) - snprintf (buffer, sizeof (buffer), _("User TAG value: %#lx"), tag); + snprintf (buffer, sizeof (buffer), + _("User TAG value: %#" PRIx64), tag); else - snprintf (buffer, sizeof (buffer), _("Unknown TAG value: %#lx"), tag); + snprintf (buffer, sizeof (buffer), + _("Unknown TAG value: %#" PRIx64), tag); return buffer; } @@ -1175,12 +1114,13 @@ get_TAG_name (unsigned long tag) static const char * get_FORM_name (unsigned long form) { - const char *name; + const char *name = NULL; if (form == 0) return "DW_FORM value: 0"; - name = get_DW_FORM_name (form); + if ((unsigned int) form == form) + name = get_DW_FORM_name ((unsigned int) form); if (name == NULL) { static char buffer[100]; @@ -1195,8 +1135,10 @@ get_FORM_name (unsigned long form) static const char * get_IDX_name (unsigned long idx) { - const char *name = get_DW_IDX_name ((unsigned int) idx); + const char *name = NULL; + if ((unsigned int) idx == idx) + name = get_DW_IDX_name ((unsigned int) idx); if (name == NULL) { static char buffer[100]; @@ -1210,20 +1152,20 @@ get_IDX_name (unsigned long idx) static unsigned char * display_block (unsigned char *data, - dwarf_vma length, + uint64_t length, const unsigned char * const end, char delimiter) { - dwarf_vma maxlen; + size_t maxlen; - printf (_("%c%s byte block: "), delimiter, dwarf_vmatoa ("u", length)); + printf (_("%c%" PRIu64 " byte block: "), delimiter, length); if (data > end) return (unsigned char *) end; - maxlen = (dwarf_vma) (end - data); + maxlen = end - data; length = length > maxlen ? maxlen : length; while (length --) - printf ("%lx ", (unsigned long) byte_get (data++, 1)); + printf ("%" PRIx64 " ", byte_get (data++, 1)); return data; } @@ -1233,13 +1175,13 @@ decode_location_expression (unsigned char * data, unsigned int pointer_size, unsigned int offset_size, int dwarf_version, - dwarf_vma length, - dwarf_vma cu_offset, + uint64_t length, + uint64_t cu_offset, struct dwarf_section * section) { unsigned op; - dwarf_vma uvalue; - dwarf_signed_vma svalue; + uint64_t uvalue; + int64_t svalue; unsigned char *end = data + length; int need_frame_base = 0; @@ -1251,54 +1193,50 @@ decode_location_expression (unsigned char * data, { case DW_OP_addr: SAFE_BYTE_GET_AND_INC (uvalue, data, pointer_size, end); - printf ("DW_OP_addr: %s", dwarf_vmatoa ("x", uvalue)); + printf ("DW_OP_addr: %" PRIx64, uvalue); break; case DW_OP_deref: printf ("DW_OP_deref"); break; case DW_OP_const1u: SAFE_BYTE_GET_AND_INC (uvalue, data, 1, end); - printf ("DW_OP_const1u: %lu", (unsigned long) uvalue); + printf ("DW_OP_const1u: %" PRIu64, uvalue); break; case DW_OP_const1s: SAFE_SIGNED_BYTE_GET_AND_INC (svalue, data, 1, end); - printf ("DW_OP_const1s: %ld", (long) svalue); + printf ("DW_OP_const1s: %" PRId64, svalue); break; case DW_OP_const2u: SAFE_BYTE_GET_AND_INC (uvalue, data, 2, end); - printf ("DW_OP_const2u: %lu", (unsigned long) uvalue); + printf ("DW_OP_const2u: %" PRIu64, uvalue); break; case DW_OP_const2s: SAFE_SIGNED_BYTE_GET_AND_INC (svalue, data, 2, end); - printf ("DW_OP_const2s: %ld", (long) svalue); + printf ("DW_OP_const2s: %" PRId64, svalue); break; case DW_OP_const4u: SAFE_BYTE_GET_AND_INC (uvalue, data, 4, end); - printf ("DW_OP_const4u: %lu", (unsigned long) uvalue); + printf ("DW_OP_const4u: %" PRIu64, uvalue); break; case DW_OP_const4s: SAFE_SIGNED_BYTE_GET_AND_INC (svalue, data, 4, end); - printf ("DW_OP_const4s: %ld", (long) svalue); + printf ("DW_OP_const4s: %" PRId64, svalue); break; case DW_OP_const8u: - SAFE_BYTE_GET_AND_INC (uvalue, data, 4, end); - printf ("DW_OP_const8u: %lu ", (unsigned long) uvalue); - SAFE_BYTE_GET_AND_INC (uvalue, data, 4, end); - printf ("%lu", (unsigned long) uvalue); + SAFE_BYTE_GET_AND_INC (uvalue, data, 8, end); + printf ("DW_OP_const8u: %" PRIu64, uvalue); break; case DW_OP_const8s: - SAFE_SIGNED_BYTE_GET_AND_INC (svalue, data, 4, end); - printf ("DW_OP_const8s: %ld ", (long) svalue); - SAFE_SIGNED_BYTE_GET_AND_INC (svalue, data, 4, end); - printf ("%ld", (long) svalue); + SAFE_SIGNED_BYTE_GET_AND_INC (svalue, data, 8, end); + printf ("DW_OP_const8s: %" PRId64, svalue); break; case DW_OP_constu: READ_ULEB (uvalue, data, end); - printf ("DW_OP_constu: %s", dwarf_vmatoa ("u", uvalue)); + printf ("DW_OP_constu: %" PRIu64, uvalue); break; case DW_OP_consts: READ_SLEB (svalue, data, end); - printf ("DW_OP_consts: %s", dwarf_vmatoa ("d", svalue)); + printf ("DW_OP_consts: %" PRId64, svalue); break; case DW_OP_dup: printf ("DW_OP_dup"); @@ -1311,7 +1249,7 @@ decode_location_expression (unsigned char * data, break; case DW_OP_pick: SAFE_BYTE_GET_AND_INC (uvalue, data, 1, end); - printf ("DW_OP_pick: %ld", (unsigned long) uvalue); + printf ("DW_OP_pick: %" PRIu64, uvalue); break; case DW_OP_swap: printf ("DW_OP_swap"); @@ -1354,7 +1292,7 @@ decode_location_expression (unsigned char * data, break; case DW_OP_plus_uconst: READ_ULEB (uvalue, data, end); - printf ("DW_OP_plus_uconst: %s", dwarf_vmatoa ("u", uvalue)); + printf ("DW_OP_plus_uconst: %" PRIu64, uvalue); break; case DW_OP_shl: printf ("DW_OP_shl"); @@ -1370,7 +1308,7 @@ decode_location_expression (unsigned char * data, break; case DW_OP_bra: SAFE_SIGNED_BYTE_GET_AND_INC (svalue, data, 2, end); - printf ("DW_OP_bra: %ld", (long) svalue); + printf ("DW_OP_bra: %" PRId64, svalue); break; case DW_OP_eq: printf ("DW_OP_eq"); @@ -1392,7 +1330,7 @@ decode_location_expression (unsigned char * data, break; case DW_OP_skip: SAFE_SIGNED_BYTE_GET_AND_INC (svalue, data, 2, end); - printf ("DW_OP_skip: %ld", (long) svalue); + printf ("DW_OP_skip: %" PRId64, svalue); break; case DW_OP_lit0: @@ -1499,38 +1437,37 @@ decode_location_expression (unsigned char * data, case DW_OP_breg30: case DW_OP_breg31: READ_SLEB (svalue, data, end); - printf ("DW_OP_breg%d (%s): %s", op - DW_OP_breg0, - regname (op - DW_OP_breg0, 1), dwarf_vmatoa ("d", svalue)); + printf ("DW_OP_breg%d (%s): %" PRId64, + op - DW_OP_breg0, regname (op - DW_OP_breg0, 1), svalue); break; case DW_OP_regx: READ_ULEB (uvalue, data, end); - printf ("DW_OP_regx: %s (%s)", - dwarf_vmatoa ("u", uvalue), regname (uvalue, 1)); + printf ("DW_OP_regx: %" PRIu64 " (%s)", + uvalue, regname (uvalue, 1)); break; case DW_OP_fbreg: need_frame_base = 1; READ_SLEB (svalue, data, end); - printf ("DW_OP_fbreg: %s", dwarf_vmatoa ("d", svalue)); + printf ("DW_OP_fbreg: %" PRId64, svalue); break; case DW_OP_bregx: READ_ULEB (uvalue, data, end); READ_SLEB (svalue, data, end); - printf ("DW_OP_bregx: %s (%s) %s", - dwarf_vmatoa ("u", uvalue), regname (uvalue, 1), - dwarf_vmatoa ("d", svalue)); + printf ("DW_OP_bregx: %" PRIu64 " (%s) %" PRId64, + uvalue, regname (uvalue, 1), svalue); break; case DW_OP_piece: READ_ULEB (uvalue, data, end); - printf ("DW_OP_piece: %s", dwarf_vmatoa ("u", uvalue)); + printf ("DW_OP_piece: %" PRIu64, uvalue); break; case DW_OP_deref_size: SAFE_BYTE_GET_AND_INC (uvalue, data, 1, end); - printf ("DW_OP_deref_size: %ld", (long) uvalue); + printf ("DW_OP_deref_size: %" PRIu64, uvalue); break; case DW_OP_xderef_size: SAFE_BYTE_GET_AND_INC (uvalue, data, 1, end); - printf ("DW_OP_xderef_size: %ld", (long) uvalue); + printf ("DW_OP_xderef_size: %" PRIu64, uvalue); break; case DW_OP_nop: printf ("DW_OP_nop"); @@ -1544,15 +1481,13 @@ decode_location_expression (unsigned char * data, /* FIXME: Strictly speaking for 64-bit DWARF3 files this ought to be an 8-byte wide computation. */ SAFE_SIGNED_BYTE_GET_AND_INC (svalue, data, 2, end); - printf ("DW_OP_call2: <0x%s>", - dwarf_vmatoa ("x", svalue + cu_offset)); + printf ("DW_OP_call2: <0x%" PRIx64 ">", svalue + cu_offset); break; case DW_OP_call4: /* FIXME: Strictly speaking for 64-bit DWARF3 files this ought to be an 8-byte wide computation. */ SAFE_SIGNED_BYTE_GET_AND_INC (svalue, data, 4, end); - printf ("DW_OP_call4: <0x%s>", - dwarf_vmatoa ("x", svalue + cu_offset)); + printf ("DW_OP_call4: <0x%" PRIx64 ">", svalue + cu_offset); break; case DW_OP_call_ref: /* FIXME: Strictly speaking for 64-bit DWARF3 files @@ -1571,7 +1506,7 @@ decode_location_expression (unsigned char * data, { SAFE_BYTE_GET_AND_INC (uvalue, data, offset_size, end); } - printf ("DW_OP_call_ref: <0x%s>", dwarf_vmatoa ("x", uvalue)); + printf ("DW_OP_call_ref: <0x%" PRIx64 ">", uvalue); break; case DW_OP_form_tls_address: printf ("DW_OP_form_tls_address"); @@ -1582,9 +1517,9 @@ decode_location_expression (unsigned char * data, case DW_OP_bit_piece: printf ("DW_OP_bit_piece: "); READ_ULEB (uvalue, data, end); - printf (_("size: %s "), dwarf_vmatoa ("u", uvalue)); + printf (_("size: %" PRIu64 " "), uvalue); READ_ULEB (uvalue, data, end); - printf (_("offset: %s "), dwarf_vmatoa ("u", uvalue)); + printf (_("offset: %" PRIu64 " "), uvalue); break; /* DWARF 4 extensions. */ @@ -1609,14 +1544,14 @@ decode_location_expression (unsigned char * data, case DW_OP_GNU_encoded_addr: { int encoding = 0; - dwarf_vma addr; + uint64_t addr; if (data < end) encoding = *data++; addr = get_encoded_value (&data, encoding, section, end); printf ("DW_OP_GNU_encoded_addr: fmt:%02x addr:", encoding); - print_dwarf_vma (addr, pointer_size); + print_hex (addr, pointer_size); } break; case DW_OP_implicit_pointer: @@ -1641,17 +1576,16 @@ decode_location_expression (unsigned char * data, SAFE_BYTE_GET_AND_INC (uvalue, data, offset_size, end); } READ_SLEB (svalue, data, end); - printf ("%s: <0x%s> %s", + printf ("%s: <0x%" PRIx64 "> %" PRId64, (op == DW_OP_implicit_pointer ? "DW_OP_implicit_pointer" : "DW_OP_GNU_implicit_pointer"), - dwarf_vmatoa ("x", uvalue), - dwarf_vmatoa ("d", svalue)); + uvalue, svalue); break; case DW_OP_entry_value: case DW_OP_GNU_entry_value: READ_ULEB (uvalue, data, end); /* PR 17531: file: 0cc9cd00. */ - if (uvalue > (dwarf_vma) (end - data)) + if (uvalue > (size_t) (end - data)) uvalue = end - data; printf ("%s: (", (op == DW_OP_entry_value ? "DW_OP_entry_value" : "DW_OP_GNU_entry_value")); @@ -1665,64 +1599,64 @@ decode_location_expression (unsigned char * data, case DW_OP_const_type: case DW_OP_GNU_const_type: READ_ULEB (uvalue, data, end); - printf ("%s: <0x%s> ", + printf ("%s: <0x%" PRIx64 "> ", (op == DW_OP_const_type ? "DW_OP_const_type" : "DW_OP_GNU_const_type"), - dwarf_vmatoa ("x", cu_offset + uvalue)); + cu_offset + uvalue); SAFE_BYTE_GET_AND_INC (uvalue, data, 1, end); data = display_block (data, uvalue, end, ' '); break; case DW_OP_regval_type: case DW_OP_GNU_regval_type: READ_ULEB (uvalue, data, end); - printf ("%s: %s (%s)", + printf ("%s: %" PRIu64 " (%s)", (op == DW_OP_regval_type ? "DW_OP_regval_type" : "DW_OP_GNU_regval_type"), - dwarf_vmatoa ("u", uvalue), regname (uvalue, 1)); + uvalue, regname (uvalue, 1)); READ_ULEB (uvalue, data, end); - printf (" <0x%s>", dwarf_vmatoa ("x", cu_offset + uvalue)); + printf (" <0x%" PRIx64 ">", cu_offset + uvalue); break; case DW_OP_deref_type: case DW_OP_GNU_deref_type: SAFE_BYTE_GET_AND_INC (uvalue, data, 1, end); - printf ("%s: %ld", + printf ("%s: %" PRId64, (op == DW_OP_deref_type ? "DW_OP_deref_type" : "DW_OP_GNU_deref_type"), - (long) uvalue); + uvalue); READ_ULEB (uvalue, data, end); - printf (" <0x%s>", dwarf_vmatoa ("x", cu_offset + uvalue)); + printf (" <0x%" PRIx64 ">", cu_offset + uvalue); break; case DW_OP_convert: case DW_OP_GNU_convert: READ_ULEB (uvalue, data, end); - printf ("%s <0x%s>", + printf ("%s <0x%" PRIx64 ">", (op == DW_OP_convert ? "DW_OP_convert" : "DW_OP_GNU_convert"), - dwarf_vmatoa ("x", uvalue ? cu_offset + uvalue : 0)); + uvalue ? cu_offset + uvalue : uvalue); break; case DW_OP_reinterpret: case DW_OP_GNU_reinterpret: READ_ULEB (uvalue, data, end); - printf ("%s <0x%s>", + printf ("%s <0x%" PRIx64 ">", (op == DW_OP_reinterpret ? "DW_OP_reinterpret" : "DW_OP_GNU_reinterpret"), - dwarf_vmatoa ("x", uvalue ? cu_offset + uvalue : 0)); + uvalue ? cu_offset + uvalue : uvalue); break; case DW_OP_GNU_parameter_ref: SAFE_BYTE_GET_AND_INC (uvalue, data, 4, end); - printf ("DW_OP_GNU_parameter_ref: <0x%s>", - dwarf_vmatoa ("x", cu_offset + uvalue)); + printf ("DW_OP_GNU_parameter_ref: <0x%" PRIx64 ">", + cu_offset + uvalue); break; case DW_OP_addrx: READ_ULEB (uvalue, data, end); - printf ("DW_OP_addrx <0x%s>", dwarf_vmatoa ("x", uvalue)); + printf ("DW_OP_addrx <0x%" PRIx64 ">", uvalue); break; case DW_OP_GNU_addr_index: READ_ULEB (uvalue, data, end); - printf ("DW_OP_GNU_addr_index <0x%s>", dwarf_vmatoa ("x", uvalue)); + printf ("DW_OP_GNU_addr_index <0x%" PRIx64 ">", uvalue); break; case DW_OP_GNU_const_index: READ_ULEB (uvalue, data, end); - printf ("DW_OP_GNU_const_index <0x%s>", dwarf_vmatoa ("x", uvalue)); + printf ("DW_OP_GNU_const_index <0x%" PRIx64 ">", uvalue); break; case DW_OP_GNU_variable_value: /* FIXME: Strictly speaking for 64-bit DWARF3 files @@ -1741,7 +1675,7 @@ decode_location_expression (unsigned char * data, { SAFE_BYTE_GET_AND_INC (uvalue, data, offset_size, end); } - printf ("DW_OP_GNU_variable_value: <0x%s>", dwarf_vmatoa ("x", uvalue)); + printf ("DW_OP_GNU_variable_value: <0x%" PRIx64 ">", uvalue); break; /* HP extensions. */ @@ -1801,7 +1735,7 @@ decode_location_expression (unsigned char * data, This is used for DWARF package files. */ static struct cu_tu_set * -find_cu_tu_set_v2 (dwarf_vma cu_offset, int do_types) +find_cu_tu_set_v2 (uint64_t cu_offset, int do_types) { struct cu_tu_set *p; unsigned int nsets; @@ -1830,7 +1764,7 @@ find_cu_tu_set_v2 (dwarf_vma cu_offset, int do_types) } static const char * -fetch_alt_indirect_string (dwarf_vma offset) +fetch_alt_indirect_string (uint64_t offset) { separate_info * i; @@ -1867,8 +1801,8 @@ fetch_alt_indirect_string (dwarf_vma offset) return ret; } - warn (_("DW_FORM_GNU_strp_alt offset (%s) too big or no string sections available\n"), - dwarf_vmatoa ("x", offset)); + warn (_("DW_FORM_GNU_strp_alt offset (%#" PRIx64 ")" + " too big or no string sections available\n"), offset); return _("<offset is too big>"); } @@ -1899,7 +1833,7 @@ get_AT_name (unsigned long attribute) } static void -add_dwo_info (const char * value, dwarf_vma cu_offset, dwo_type type) +add_dwo_info (const char * value, uint64_t cu_offset, dwo_type type) { dwo_info * dwinfo = xmalloc (sizeof * dwinfo); @@ -1911,19 +1845,19 @@ add_dwo_info (const char * value, dwarf_vma cu_offset, dwo_type type) } static void -add_dwo_name (const char * name, dwarf_vma cu_offset) +add_dwo_name (const char * name, uint64_t cu_offset) { add_dwo_info (name, cu_offset, DWO_NAME); } static void -add_dwo_dir (const char * dir, dwarf_vma cu_offset) +add_dwo_dir (const char * dir, uint64_t cu_offset) { add_dwo_info (dir, cu_offset, DWO_DIR); } static void -add_dwo_id (const char * id, dwarf_vma cu_offset) +add_dwo_id (const char * id, uint64_t cu_offset) { add_dwo_info (id, cu_offset, DWO_ID); } @@ -1945,18 +1879,18 @@ free_dwo_info (void) /* Ensure that START + UVALUE is less than END. Return an adjusted UVALUE if necessary to ensure this relationship. */ -static inline dwarf_vma -check_uvalue (const unsigned char * start, - dwarf_vma uvalue, - const unsigned char * end) +static inline uint64_t +check_uvalue (const unsigned char *start, + uint64_t uvalue, + const unsigned char *end) { - dwarf_vma max_uvalue = end - start; + uint64_t max_uvalue = end - start; /* See PR 17512: file: 008-103549-0.001:0.1. and PR 24829 for examples of where these tests are triggered. */ if (uvalue > max_uvalue) { - warn (_("Corrupt attribute block length: %lx\n"), (long) uvalue); + warn (_("Corrupt attribute block length: %#" PRIx64 "\n"), uvalue); uvalue = max_uvalue; } @@ -1967,14 +1901,14 @@ static unsigned char * skip_attr_bytes (unsigned long form, unsigned char *data, unsigned char *end, - dwarf_vma pointer_size, - dwarf_vma offset_size, + uint64_t pointer_size, + uint64_t offset_size, int dwarf_version, - dwarf_vma *value_return) + uint64_t *value_return) { - dwarf_signed_vma svalue; - dwarf_vma uvalue = 0; - dwarf_vma inc = 0; + int64_t svalue; + uint64_t uvalue = 0; + uint64_t inc = 0; * value_return = 0; @@ -2098,7 +2032,7 @@ skip_attr_bytes (unsigned long form, } * value_return = uvalue; - if (inc <= (dwarf_vma) (end - data)) + if (inc <= (size_t) (end - data)) data += inc; else data = end; @@ -2111,7 +2045,7 @@ skip_attr_bytes (unsigned long form, static abbrev_entry * get_type_abbrev_from_form (unsigned long form, unsigned long uvalue, - dwarf_vma cu_offset, + uint64_t cu_offset, unsigned char *cu_end, const struct dwarf_section *section, unsigned long *abbrev_num_return, @@ -2138,8 +2072,9 @@ get_type_abbrev_from_form (unsigned long form, case DW_FORM_ref_addr: if (uvalue >= section->size) { - warn (_("Unable to resolve ref_addr form: uvalue %lx > section size %lx (%s)\n"), - uvalue, (long) section->size, section->name); + warn (_("Unable to resolve ref_addr form: uvalue %lx " + "> section size %" PRIx64 " (%s)\n"), + uvalue, section->size, section->name); return NULL; } break; @@ -2156,8 +2091,9 @@ get_type_abbrev_from_form (unsigned long form, if (uvalue + cu_offset < uvalue || uvalue + cu_offset > (size_t) (cu_end - section->start)) { - warn (_("Unable to resolve ref form: uvalue %lx + cu_offset %lx > CU size %lx\n"), - uvalue, (long) cu_offset, (long) (cu_end - section->start)); + warn (_("Unable to resolve ref form: uvalue %lx + cu_offset %" PRIx64 + " > CU size %tx\n"), + uvalue, cu_offset, cu_end - section->start); return NULL; } uvalue += cu_offset; @@ -2219,9 +2155,9 @@ get_type_signedness (abbrev_entry *entry, const struct dwarf_section *section, unsigned char *data, unsigned char *end, - dwarf_vma cu_offset, - dwarf_vma pointer_size, - dwarf_vma offset_size, + uint64_t cu_offset, + uint64_t pointer_size, + uint64_t offset_size, int dwarf_version, bool *is_signed, unsigned int nesting) @@ -2243,7 +2179,7 @@ get_type_signedness (abbrev_entry *entry, attr = attr->next) { unsigned char * orig_data = data; - dwarf_vma uvalue = 0; + uint64_t uvalue = 0; data = skip_attr_bytes (attr->form, data, end, pointer_size, offset_size, dwarf_version, & uvalue); @@ -2325,18 +2261,20 @@ read_and_print_leb128 (unsigned char *data, bool is_signed) { int status; - dwarf_vma val = read_leb128 (data, end, is_signed, bytes_read, &status); + uint64_t val = read_leb128 (data, end, is_signed, bytes_read, &status); if (status != 0) report_leb_status (status); + else if (is_signed) + printf ("%" PRId64, val); else - printf ("%s", dwarf_vmatoa (is_signed ? "d" : "u", val)); + printf ("%" PRIu64, val); } static void -display_discr_list (unsigned long form, - dwarf_vma uvalue, - unsigned char * data, - int level) +display_discr_list (unsigned long form, + uint64_t uvalue, + unsigned char *data, + int level) { unsigned char *end = data; @@ -2415,26 +2353,26 @@ display_discr_list (unsigned long form, } static unsigned char * -read_and_display_attr_value (unsigned long attribute, - unsigned long form, - dwarf_signed_vma implicit_const, - unsigned char * start, - unsigned char * data, - unsigned char * end, - dwarf_vma cu_offset, - dwarf_vma pointer_size, - dwarf_vma offset_size, - int dwarf_version, - debug_info * debug_info_p, - int do_loc, - struct dwarf_section * section, - struct cu_tu_set * this_set, - char delimiter, - int level) -{ - dwarf_signed_vma svalue; - dwarf_vma uvalue = 0; - dwarf_vma uvalue_hi = 0; +read_and_display_attr_value (unsigned long attribute, + unsigned long form, + int64_t implicit_const, + unsigned char *start, + unsigned char *data, + unsigned char *end, + uint64_t cu_offset, + uint64_t pointer_size, + uint64_t offset_size, + int dwarf_version, + debug_info *debug_info_p, + int do_loc, + struct dwarf_section *section, + struct cu_tu_set *this_set, + char delimiter, + int level) +{ + int64_t svalue; + uint64_t uvalue = 0; + uint64_t uvalue_hi = 0; unsigned char *block_start = NULL; unsigned char *orig_data = data; @@ -2523,7 +2461,7 @@ read_and_display_attr_value (unsigned long attribute, SAFE_BYTE_GET_AND_INC (uvalue_hi, data, 8, end); if (byte_get != byte_get_little_endian) { - dwarf_vma utmp = uvalue; + uint64_t utmp = uvalue; uvalue = uvalue_hi; uvalue_hi = utmp; } @@ -2570,7 +2508,7 @@ read_and_display_attr_value (unsigned long attribute, { case DW_FORM_ref_addr: if (!do_loc) - printf ("%c<0x%s>", delimiter, dwarf_vmatoa ("x", uvalue)); + printf ("%c<0x%" PRIx64 ">", delimiter, uvalue); break; case DW_FORM_GNU_ref_alt: @@ -2578,9 +2516,9 @@ read_and_display_attr_value (unsigned long attribute, { if (do_wide) /* We have already printed the form name. */ - printf ("%c<0x%s>", delimiter, dwarf_vmatoa ("x", uvalue)); + printf ("%c<0x%" PRIx64 ">", delimiter, uvalue); else - printf ("%c<alt 0x%s>", delimiter, dwarf_vmatoa ("x", uvalue)); + printf ("%c<alt 0x%" PRIx64 ">", delimiter, uvalue); } /* FIXME: Follow the reference... */ break; @@ -2591,14 +2529,14 @@ read_and_display_attr_value (unsigned long attribute, case DW_FORM_ref_sup4: case DW_FORM_ref_udata: if (!do_loc) - printf ("%c<0x%s>", delimiter, dwarf_vmatoa ("x", uvalue + cu_offset)); + printf ("%c<0x%" PRIx64 ">", delimiter, uvalue + cu_offset); break; case DW_FORM_data4: case DW_FORM_addr: case DW_FORM_sec_offset: if (!do_loc) - printf ("%c0x%s", delimiter, dwarf_vmatoa ("x", uvalue)); + printf ("%c0x%" PRIx64, delimiter, uvalue); break; case DW_FORM_flag_present: @@ -2607,17 +2545,17 @@ read_and_display_attr_value (unsigned long attribute, case DW_FORM_data2: case DW_FORM_sdata: if (!do_loc) - printf ("%c%s", delimiter, dwarf_vmatoa ("d", uvalue)); + printf ("%c%" PRId64, delimiter, uvalue); break; case DW_FORM_udata: if (!do_loc) - printf ("%c%s", delimiter, dwarf_vmatoa ("u", uvalue)); + printf ("%c%" PRIu64, delimiter, uvalue); break; case DW_FORM_implicit_const: if (!do_loc) - printf ("%c%s", delimiter, dwarf_vmatoa ("d", implicit_const)); + printf ("%c%" PRId64, delimiter, implicit_const); break; case DW_FORM_ref_sup8: @@ -2625,18 +2563,21 @@ read_and_display_attr_value (unsigned long attribute, case DW_FORM_data8: if (!do_loc) { - dwarf_vma utmp = uvalue; + uint64_t utmp = uvalue; if (form == DW_FORM_ref8) utmp += cu_offset; - printf ("%c0x%s", delimiter, dwarf_vmatoa ("x", utmp)); + printf ("%c0x%" PRIx64, delimiter, utmp); } break; case DW_FORM_data16: if (!do_loc) - printf (" 0x%s%s", - uvalue_hi == 0 ? "" : dwarf_vmatoa ("x", uvalue_hi), - dwarf_vmatoa_1 ("x", uvalue, uvalue_hi == 0 ? 0 : 8)); + { + if (uvalue_hi == 0) + printf (" 0x%" PRIx64, uvalue); + else + printf (" 0x%" PRIx64 "%016" PRIx64, uvalue_hi, uvalue); + } break; case DW_FORM_string: @@ -2689,13 +2630,11 @@ read_and_display_attr_value (unsigned long attribute, { if (do_wide) /* We have already displayed the form name. */ - printf (_("%c(offset: 0x%s): %s"), delimiter, - dwarf_vmatoa ("x", uvalue), - fetch_indirect_string (uvalue)); + printf (_("%c(offset: 0x%" PRIx64 "): %s"), + delimiter, uvalue, fetch_indirect_string (uvalue)); else - printf (_("%c(indirect string, offset: 0x%s): %s"), delimiter, - dwarf_vmatoa ("x", uvalue), - fetch_indirect_string (uvalue)); + printf (_("%c(indirect string, offset: 0x%" PRIx64 "): %s"), + delimiter, uvalue, fetch_indirect_string (uvalue)); } break; @@ -2704,13 +2643,11 @@ read_and_display_attr_value (unsigned long attribute, { if (do_wide) /* We have already displayed the form name. */ - printf (_("%c(offset: 0x%s): %s"), delimiter, - dwarf_vmatoa ("x", uvalue), - fetch_indirect_line_string (uvalue)); + printf (_("%c(offset: 0x%" PRIx64 "): %s"), + delimiter, uvalue, fetch_indirect_line_string (uvalue)); else - printf (_("%c(indirect line string, offset: 0x%s): %s"), delimiter, - dwarf_vmatoa ("x", uvalue), - fetch_indirect_line_string (uvalue)); + printf (_("%c(indirect line string, offset: 0x%" PRIx64 "): %s"), + delimiter, uvalue, fetch_indirect_line_string (uvalue)); } break; @@ -2730,11 +2667,11 @@ read_and_display_attr_value (unsigned long attribute, debug_info_p ? debug_info_p->str_offsets_base : 0); if (do_wide) /* We have already displayed the form name. */ - printf (_("%c(offset: 0x%s): %s"), delimiter, - dwarf_vmatoa ("x", uvalue), strng); + printf (_("%c(offset: 0x%" PRIx64 "): %s"), + delimiter, uvalue, strng); else - printf (_("%c(indexed string: 0x%s): %s"), delimiter, - dwarf_vmatoa ("x", uvalue), strng); + printf (_("%c(indexed string: 0x%" PRIx64 "): %s"), + delimiter, uvalue, strng); } break; @@ -2743,13 +2680,11 @@ read_and_display_attr_value (unsigned long attribute, { if (do_wide) /* We have already displayed the form name. */ - printf (_("%c(offset: 0x%s) %s"), delimiter, - dwarf_vmatoa ("x", uvalue), - fetch_alt_indirect_string (uvalue)); + printf (_("%c(offset: 0x%" PRIx64 ") %s"), + delimiter, uvalue, fetch_alt_indirect_string (uvalue)); else - printf (_("%c(alt indirect string, offset: 0x%s) %s"), delimiter, - dwarf_vmatoa ("x", uvalue), - fetch_alt_indirect_string (uvalue)); + printf (_("%c(alt indirect string, offset: 0x%" PRIx64 ") %s"), + delimiter, uvalue, fetch_alt_indirect_string (uvalue)); } break; @@ -2759,8 +2694,8 @@ read_and_display_attr_value (unsigned long attribute, case DW_FORM_ref_sig8: if (!do_loc) - printf ("%c%s: 0x%s", delimiter, do_wide ? "" : "signature", - dwarf_vmatoa ("x", uvalue)); + printf ("%c%s: 0x%" PRIx64, delimiter, do_wide ? "" : "signature", + uvalue); break; case DW_FORM_GNU_addr_index: @@ -2773,7 +2708,7 @@ read_and_display_attr_value (unsigned long attribute, case DW_FORM_rnglistx: if (!do_loc) { - dwarf_vma base, idx; + uint64_t base, idx; const char *suffix = strrchr (section->name, '.'); bool dwo = suffix && strcmp (suffix, ".dwo") == 0; @@ -2782,7 +2717,7 @@ read_and_display_attr_value (unsigned long attribute, if (dwo) { idx = fetch_indexed_value (uvalue, loclists_dwo, 0); - if (idx != (dwarf_vma) -1) + if (idx != (uint64_t) -1) idx += (offset_size == 8) ? 20 : 12; } else if (debug_info_p == NULL) @@ -2810,7 +2745,7 @@ read_and_display_attr_value (unsigned long attribute, if (dwo) { idx = fetch_indexed_value (uvalue, rnglists_dwo, 0); - if (idx != (dwarf_vma) -1) + if (idx != (uint64_t) -1) idx += (offset_size == 8) ? 20 : 12; } else @@ -2822,7 +2757,7 @@ read_and_display_attr_value (unsigned long attribute, /* We do not have a cached value this time, so we perform the computation manually. */ idx = fetch_indexed_value (uvalue, rnglists, base); - if (idx != (dwarf_vma) -1) + if (idx != (uint64_t) -1) idx += base; } } @@ -2840,16 +2775,15 @@ read_and_display_attr_value (unsigned long attribute, } /* We have already displayed the form name. */ - if (idx != (dwarf_vma) -1) - printf (_("%c(index: 0x%s): %s"), delimiter, - dwarf_vmatoa ("x", uvalue), - dwarf_vmatoa ("x", idx)); + if (idx != (uint64_t) -1) + printf (_("%c(index: 0x%" PRIx64 "): %" PRIx64), + delimiter, uvalue, idx); } break; case DW_FORM_strp_sup: if (!do_loc) - printf ("%c<0x%s>", delimiter, dwarf_vmatoa ("x", uvalue + cu_offset)); + printf ("%c<0x%" PRIx64 ">", delimiter, uvalue + cu_offset); break; default: @@ -2867,26 +2801,26 @@ read_and_display_attr_value (unsigned long attribute, { case DW_AT_loclists_base: if (debug_info_p->loclists_base) - warn (_("CU @ 0x%s has multiple loclists_base values (0x%s and 0x%s)"), - dwarf_vmatoa ("x", debug_info_p->cu_offset), - dwarf_vmatoa ("x", debug_info_p->loclists_base), - dwarf_vmatoa ("x", uvalue)); + warn (_("CU @ %#" PRIx64 " has multiple loclists_base values " + "(%#" PRIx64 " and %#" PRIx64 ")"), + debug_info_p->cu_offset, + debug_info_p->loclists_base, uvalue); debug_info_p->loclists_base = uvalue; break; case DW_AT_rnglists_base: if (debug_info_p->rnglists_base) - warn (_("CU @ 0x%s has multiple rnglists_base values (0x%s and 0x%s)"), - dwarf_vmatoa ("x", debug_info_p->cu_offset), - dwarf_vmatoa ("x", debug_info_p->rnglists_base), - dwarf_vmatoa ("x", uvalue)); + warn (_("CU @ %#" PRIx64 " has multiple rnglists_base values " + "(%#" PRIx64 " and %#" PRIx64 ")"), + debug_info_p->cu_offset, + debug_info_p->rnglists_base, uvalue); debug_info_p->rnglists_base = uvalue; break; case DW_AT_str_offsets_base: if (debug_info_p->str_offsets_base) - warn (_("CU @ 0x%s has multiple str_offsets_base values (0x%s and 0x%s)"), - dwarf_vmatoa ("x", debug_info_p->cu_offset), - dwarf_vmatoa ("x", debug_info_p->str_offsets_base), - dwarf_vmatoa ("x", uvalue)); + warn (_("CU @ %#" PRIx64 " has multiple str_offsets_base values " + "%#" PRIx64 " and %#" PRIx64 ")"), + debug_info_p->cu_offset, + debug_info_p->str_offsets_base, uvalue); debug_info_p->str_offsets_base = uvalue; break; @@ -2922,10 +2856,10 @@ read_and_display_attr_value (unsigned long attribute, if (lmax == 0 || num >= lmax) { lmax += 1024; - debug_info_p->loc_offsets = (dwarf_vma *) + debug_info_p->loc_offsets = (uint64_t *) xcrealloc (debug_info_p->loc_offsets, lmax, sizeof (*debug_info_p->loc_offsets)); - debug_info_p->loc_views = (dwarf_vma *) + debug_info_p->loc_views = (uint64_t *) xcrealloc (debug_info_p->loc_views, lmax, sizeof (*debug_info_p->loc_views)); debug_info_p->have_frame_base = (int *) @@ -2996,7 +2930,7 @@ read_and_display_attr_value (unsigned long attribute, if (lmax == 0 || num >= lmax) { lmax += 1024; - debug_info_p->range_lists = (dwarf_vma *) + debug_info_p->range_lists = (uint64_t *) xcrealloc (debug_info_p->range_lists, lmax, sizeof (*debug_info_p->range_lists)); debug_info_p->max_range_lists = lmax; @@ -3143,8 +3077,8 @@ read_and_display_attr_value (unsigned long attribute, printf (_("(declared as inline and inlined)")); break; default: - printf (_(" (Unknown inline attribute value: %s)"), - dwarf_vmatoa ("x", uvalue)); + printf (_(" (Unknown inline attribute value: %#" PRIx64 ")"), + uvalue); break; } break; @@ -3200,10 +3134,9 @@ read_and_display_attr_value (unsigned long attribute, case DW_LANG_Upc: printf ("(Unified Parallel C)"); break; default: if (uvalue >= DW_LANG_lo_user && uvalue <= DW_LANG_hi_user) - printf (_("(implementation defined: %s)"), - dwarf_vmatoa ("x", uvalue)); + printf (_("(implementation defined: %#" PRIx64 ")"), uvalue); else - printf (_("(Unknown: %s)"), dwarf_vmatoa ("x", uvalue)); + printf (_("(unknown: %#" PRIx64 ")"), uvalue); break; } break; @@ -3460,9 +3393,9 @@ read_and_display_attr_value (unsigned long attribute, if (entry == NULL) { if (form != DW_FORM_GNU_ref_alt) - warn (_("Offset %s used as value for DW_AT_import attribute of DIE at offset 0x%lx is too big.\n"), - dwarf_vmatoa ("x", uvalue), - (unsigned long) (orig_data - section->start)); + warn (_("Offset %#" PRIx64 " used as value for DW_AT_import attribute of DIE at offset %#tx is too big.\n"), + uvalue, + orig_data - section->start); } else { @@ -3481,21 +3414,21 @@ read_and_display_attr_value (unsigned long attribute, } static unsigned char * -read_and_display_attr (unsigned long attribute, - unsigned long form, - dwarf_signed_vma implicit_const, - unsigned char * start, - unsigned char * data, - unsigned char * end, - dwarf_vma cu_offset, - dwarf_vma pointer_size, - dwarf_vma offset_size, - int dwarf_version, - debug_info * debug_info_p, - int do_loc, - struct dwarf_section * section, - struct cu_tu_set * this_set, - int level) +read_and_display_attr (unsigned long attribute, + unsigned long form, + int64_t implicit_const, + unsigned char *start, + unsigned char *data, + unsigned char *end, + uint64_t cu_offset, + uint64_t pointer_size, + uint64_t offset_size, + int dwarf_version, + debug_info *debug_info_p, + int do_loc, + struct dwarf_section *section, + struct cu_tu_set *this_set, + int level) { if (!do_loc) printf (" %-18s:", get_AT_name (attribute)); @@ -3604,7 +3537,7 @@ process_debug_info (struct dwarf_section * section, for (section_begin = start, num_units = 0; section_begin < end; num_units ++) { - dwarf_vma length; + uint64_t length; /* Read the first 4 bytes. For a 32-bit DWARF section, this will be the length. For a 64-bit DWARF section, it'll be @@ -3615,8 +3548,8 @@ process_debug_info (struct dwarf_section * section, SAFE_BYTE_GET_AND_INC (length, section_begin, 8, end); else if (length >= 0xfffffff0 && length < 0xffffffff) { - warn (_("Reserved length value (0x%s) found in section %s\n"), - dwarf_vmatoa ("x", length), section->name); + warn (_("Reserved length value (%#" PRIx64 ") found in section %s\n"), + length, section->name); return false; } @@ -3625,10 +3558,9 @@ process_debug_info (struct dwarf_section * section, relocations to an object file, or if the file is corrupt. */ if (length > (size_t) (end - section_begin)) { - warn (_("Corrupt unit length (got 0x%s expected at most 0x%s) in section %s\n"), - dwarf_vmatoa ("x", length), - dwarf_vmatoa ("x", end - section_begin), - section->name); + warn (_("Corrupt unit length (got %#" PRIx64 + " expected at most %#tx) in section %s\n"), + length, end - section_begin, section->name); return false; } section_begin += length; @@ -3700,13 +3632,13 @@ process_debug_info (struct dwarf_section * section, every CU header twice. */ for (section_begin = start; start < end;) { - DWARF2_Internal_CompUnit compunit; - unsigned char * hdrptr; - dwarf_vma abbrev_base; - size_t abbrev_size; - dwarf_vma cu_offset; - unsigned int offset_size; - struct cu_tu_set * this_set; + DWARF2_Internal_CompUnit compunit; + unsigned char *hdrptr; + uint64_t abbrev_base; + size_t abbrev_size; + uint64_t cu_offset; + unsigned int offset_size; + struct cu_tu_set *this_set; unsigned char *end_cu; hdrptr = start; @@ -3782,12 +3714,12 @@ process_debug_info (struct dwarf_section * section, unsigned char *hdrptr; unsigned char *tags; int level, last_level, saved_level; - dwarf_vma cu_offset; + uint64_t cu_offset; unsigned int offset_size; - dwarf_vma signature = 0; - dwarf_vma type_offset = 0; + uint64_t signature = 0; + uint64_t type_offset = 0; struct cu_tu_set *this_set; - dwarf_vma abbrev_base; + uint64_t abbrev_base; size_t abbrev_size; unsigned char *end_cu; @@ -3896,10 +3828,10 @@ process_debug_info (struct dwarf_section * section, if (!do_loc && dwarf_start_die == 0) { - printf (_(" Compilation Unit @ offset 0x%s:\n"), - dwarf_vmatoa ("x", cu_offset)); - printf (_(" Length: 0x%s (%s)\n"), - dwarf_vmatoa ("x", compunit.cu_length), + printf (_(" Compilation Unit @ offset 0x%" PRIx64 ":\n"), + cu_offset); + printf (_(" Length: 0x%" PRIx64 " (%s)\n"), + compunit.cu_length, offset_size == 8 ? "64-bit" : "32-bit"); printf (_(" Version: %d\n"), compunit.cu_version); if (compunit.cu_version >= 5) @@ -3910,36 +3842,30 @@ process_debug_info (struct dwarf_section * section, name ? name : "???", compunit.cu_unit_type); } - printf (_(" Abbrev Offset: 0x%s\n"), - dwarf_vmatoa ("x", compunit.cu_abbrev_offset)); + printf (_(" Abbrev Offset: 0x%" PRIx64 "\n"), + compunit.cu_abbrev_offset); printf (_(" Pointer Size: %d\n"), compunit.cu_pointer_size); if (do_types) { - printf (_(" Signature: 0x%s\n"), - dwarf_vmatoa ("x", signature)); - printf (_(" Type Offset: 0x%s\n"), - dwarf_vmatoa ("x", type_offset)); + printf (_(" Signature: 0x%" PRIx64 "\n"), signature); + printf (_(" Type Offset: 0x%" PRIx64 "\n"), type_offset); } if (do_dwo_id) - printf (_(" DWO ID: 0x%s\n"), dwarf_vmatoa ("x", dwo_id)); + printf (_(" DWO ID: 0x%" PRIx64 "\n"), dwo_id); if (this_set != NULL) { - dwarf_vma *offsets = this_set->section_offsets; + uint64_t *offsets = this_set->section_offsets; size_t *sizes = this_set->section_sizes; printf (_(" Section contributions:\n")); - printf (_(" .debug_abbrev.dwo: 0x%s 0x%s\n"), - dwarf_vmatoa ("x", offsets [DW_SECT_ABBREV]), - dwarf_vmatoa ("x", sizes [DW_SECT_ABBREV])); - printf (_(" .debug_line.dwo: 0x%s 0x%s\n"), - dwarf_vmatoa ("x", offsets [DW_SECT_LINE]), - dwarf_vmatoa ("x", sizes [DW_SECT_LINE])); - printf (_(" .debug_loc.dwo: 0x%s 0x%s\n"), - dwarf_vmatoa ("x", offsets [DW_SECT_LOC]), - dwarf_vmatoa ("x", sizes [DW_SECT_LOC])); - printf (_(" .debug_str_offsets.dwo: 0x%s 0x%s\n"), - dwarf_vmatoa ("x", offsets [DW_SECT_STR_OFFSETS]), - dwarf_vmatoa ("x", sizes [DW_SECT_STR_OFFSETS])); + printf (_(" .debug_abbrev.dwo: 0x%" PRIx64 " 0x%zx\n"), + offsets[DW_SECT_ABBREV], sizes[DW_SECT_ABBREV]); + printf (_(" .debug_line.dwo: 0x%" PRIx64 " 0x%zx\n"), + offsets[DW_SECT_LINE], sizes[DW_SECT_LINE]); + printf (_(" .debug_loc.dwo: 0x%" PRIx64 " 0x%zx\n"), + offsets[DW_SECT_LOC], sizes[DW_SECT_LOC]); + printf (_(" .debug_str_offsets.dwo: 0x%" PRIx64 " 0x%zx\n"), + offsets[DW_SECT_STR_OFFSETS], sizes[DW_SECT_STR_OFFSETS]); } } @@ -3948,9 +3874,9 @@ process_debug_info (struct dwarf_section * section, if (compunit.cu_version < 2 || compunit.cu_version > 5) { - warn (_("CU at offset %s contains corrupt or " + warn (_("CU at offset %#" PRIx64 " contains corrupt or " "unsupported version number: %d.\n"), - dwarf_vmatoa ("x", cu_offset), compunit.cu_version); + cu_offset, compunit.cu_version); continue; } @@ -3960,9 +3886,9 @@ process_debug_info (struct dwarf_section * section, && compunit.cu_unit_type != DW_UT_split_compile && compunit.cu_unit_type != DW_UT_skeleton) { - warn (_("CU at offset %s contains corrupt or " + warn (_("CU at offset %#" PRIx64 " contains corrupt or " "unsupported unit type: %d.\n"), - dwarf_vmatoa ("x", cu_offset), compunit.cu_unit_type); + cu_offset, compunit.cu_unit_type); continue; } @@ -4062,7 +3988,7 @@ process_debug_info (struct dwarf_section * section, printf ("\n"); fflush (stdout); } - warn (_("DIE at offset 0x%lx refers to abbreviation number %lu which does not exist\n"), + warn (_("DIE at offset %#lx refers to abbreviation number %lu which does not exist\n"), die_offset, abbrev_number); return false; } @@ -4102,7 +4028,7 @@ process_debug_info (struct dwarf_section * section, { if (! do_loc && do_printing) /* Show the offset from where the tag was extracted. */ - printf (" <%lx>", (unsigned long)(tags - section_begin)); + printf (" <%tx>", tags - section_begin); tags = read_and_display_attr (attr->attribute, attr->form, attr->implicit_const, @@ -4127,7 +4053,7 @@ process_debug_info (struct dwarf_section * section, switch (debug_info_p->num_loc_offsets - debug_info_p->num_loc_views) { case 1: - debug_info_p->loc_views [debug_info_p->num_loc_views] = vm1; + debug_info_p->loc_views [debug_info_p->num_loc_views] = -1; debug_info_p->num_loc_views++; assert (debug_info_p->num_loc_views == debug_info_p->num_loc_offsets); @@ -4248,8 +4174,10 @@ read_debug_line_header (struct dwarf_section * section, } else { - warn (_("The length field (0x%lx) in the debug_line header is wrong - the section is too small\n"), - (long) linfo->li_length); + warn (_("The length field (%#" PRIx64 ")" + " in the debug_line header is wrong" + " - the section is too small\n"), + linfo->li_length); return NULL; } } @@ -4317,7 +4245,7 @@ display_formatted_table (unsigned char *data, bool is_dir) { unsigned char *format_start, format_count, *format, formati; - dwarf_vma data_count, datai; + uint64_t data_count, datai; unsigned int namepass, last_entry = 0; const char * table_name = is_dir ? N_("Directory Table") : N_("File Name Table"); @@ -4346,8 +4274,8 @@ display_formatted_table (unsigned char *data, } else if (data >= end) { - warn (_("%s: Corrupt entry count - expected %s but none found\n"), - table_name, dwarf_vmatoa ("x", data_count)); + warn (_("%s: Corrupt entry count - expected %#" PRIx64 + " but none found\n"), table_name, data_count); return data; } @@ -4358,9 +4286,8 @@ display_formatted_table (unsigned char *data, return end; } - printf (_("\n The %s (offset 0x%lx, lines %s, columns %u):\n"), - table_name, (long) (data - start), dwarf_vmatoa ("u", data_count), - format_count); + printf (_("\n The %s (offset 0x%tx, lines %" PRIu64 ", columns %u):\n"), + table_name, data - start, data_count, format_count); printf (_(" Entry")); /* Delay displaying name as the last entry for better screen layout. */ @@ -4369,7 +4296,7 @@ display_formatted_table (unsigned char *data, format = format_start; for (formati = 0; formati < format_count; formati++) { - dwarf_vma content_type; + uint64_t content_type; READ_ULEB (content_type, format, end); if ((content_type == DW_LNCT_path) == (namepass == 1)) @@ -4391,8 +4318,8 @@ display_formatted_table (unsigned char *data, printf (_("\tMD5\t\t\t")); break; default: - printf (_("\t(Unknown format content type %s)"), - dwarf_vmatoa ("u", content_type)); + printf (_("\t(Unknown format content type %" PRIu64 ")"), + content_type); } SKIP_ULEB (format, end); } @@ -4411,7 +4338,7 @@ display_formatted_table (unsigned char *data, data = datapass; for (formati = 0; formati < format_count; formati++) { - dwarf_vma content_type, form; + uint64_t content_type, form; READ_ULEB (content_type, format, end); READ_ULEB (form, format, end); @@ -4445,7 +4372,7 @@ display_debug_sup (struct dwarf_section * section, size_t sup_filename_len; unsigned int num_read; int status; - dwarf_vma checksum_len; + uint64_t checksum_len; introduce (section, true); @@ -4483,21 +4410,22 @@ display_debug_sup (struct dwarf_section * section, checksum_len = 0; } start += num_read; - if (checksum_len > (dwarf_vma) (end - start)) + if (checksum_len > (size_t) (end - start)) { error (_("corrupt .debug_sup section: checksum length is longer than the remaining section length\n")); checksum_len = end - start; } - else if (checksum_len < (dwarf_vma) (end - start)) + else if (checksum_len < (size_t) (end - start)) { - warn (_("corrupt .debug_sup section: there are 0x%lx extra, unused bytes at the end of the section\n"), - (long) ((end - start) - checksum_len)); + warn (_("corrupt .debug_sup section: there are %#" PRIx64 + " extra, unused bytes at the end of the section\n"), + (end - start) - checksum_len); } printf (_(" Version: %u\n"), version); printf (_(" Is Supp: %u\n"), is_supplementary); printf (_(" Filename: %s\n"), sup_filename); - printf (_(" Checksum Len: %lu\n"), (long) checksum_len); + printf (_(" Checksum Len: %" PRIu64 "\n"), checksum_len); if (checksum_len > 0) { printf (_(" Checksum: ")); @@ -4561,8 +4489,8 @@ display_debug_lines_raw (struct dwarf_section * section, & end_of_sequence)) == NULL) return 0; - printf (_(" Offset: 0x%lx\n"), (long)(data - start)); - printf (_(" Length: %ld\n"), (long) linfo.li_length); + printf (_(" Offset: 0x%tx\n"), data - start); + printf (_(" Length: %" PRId64 "\n"), linfo.li_length); printf (_(" DWARF Version: %d\n"), linfo.li_version); if (linfo.li_version >= 5) { @@ -4625,8 +4553,8 @@ display_debug_lines_raw (struct dwarf_section * section, { unsigned int last_dir_entry = 0; - printf (_("\n The Directory Table (offset 0x%lx):\n"), - (long)(data - start)); + printf (_("\n The Directory Table (offset 0x%tx):\n"), + data - start); while (data < end && *data != 0) { @@ -4651,14 +4579,14 @@ display_debug_lines_raw (struct dwarf_section * section, printf (_("\n The File Name Table is empty.\n")); else { - printf (_("\n The File Name Table (offset 0x%lx):\n"), - (long)(data - start)); + printf (_("\n The File Name Table (offset 0x%tx):\n"), + data - start); printf (_(" Entry\tDir\tTime\tSize\tName\n")); while (data < end && *data != 0) { unsigned char *name; - dwarf_vma val; + uint64_t val; printf (" %d\t", ++state_machine_regs.last_file_entry); name = data; @@ -4667,11 +4595,11 @@ display_debug_lines_raw (struct dwarf_section * section, data++; READ_ULEB (val, data, end); - printf ("%s\t", dwarf_vmatoa ("u", val)); + printf ("%" PRIu64 "\t", val); READ_ULEB (val, data, end); - printf ("%s\t", dwarf_vmatoa ("u", val)); + printf ("%" PRIu64 "\t", val); READ_ULEB (val, data, end); - printf ("%s\t", dwarf_vmatoa ("u", val)); + printf ("%" PRIu64 "\t", val); printf ("%.*s\n", (int)(end - name), name); if (data >= end) @@ -4701,10 +4629,10 @@ display_debug_lines_raw (struct dwarf_section * section, while (data < end_of_sequence) { unsigned char op_code; - dwarf_signed_vma adv; - dwarf_vma uladv; + int64_t adv; + uint64_t uladv; - printf (" [0x%08lx]", (long)(data - start)); + printf (" [0x%08tx]", data - start); op_code = *data++; @@ -4719,9 +4647,9 @@ display_debug_lines_raw (struct dwarf_section * section, if (uladv) state_machine_regs.view = 0; printf (_(" Special opcode %d: " - "advance Address by %s to 0x%s%s"), - op_code, dwarf_vmatoa ("u", uladv), - dwarf_vmatoa ("x", state_machine_regs.address), + "advance Address by %" PRIu64 + " to 0x%" PRIx64 "%s"), + op_code, uladv, state_machine_regs.address, verbose_view && uladv ? _(" (reset view)") : ""); } @@ -4739,17 +4667,17 @@ display_debug_lines_raw (struct dwarf_section * section, if (addrdelta) state_machine_regs.view = 0; printf (_(" Special opcode %d: " - "advance Address by %s to 0x%s[%d]%s"), - op_code, dwarf_vmatoa ("u", uladv), - dwarf_vmatoa ("x", state_machine_regs.address), + "advance Address by %" PRIu64 + " to 0x%" PRIx64 "[%d]%s"), + op_code, uladv, state_machine_regs.address, state_machine_regs.op_index, verbose_view && addrdelta ? _(" (reset view)") : ""); } adv = (op_code % linfo.li_line_range) + linfo.li_line_base; state_machine_regs.line += adv; - printf (_(" and Line by %s to %d"), - dwarf_vmatoa ("d", adv), state_machine_regs.line); + printf (_(" and Line by %" PRId64 " to %d"), + adv, state_machine_regs.line); if (verbose_view || state_machine_regs.view) printf (_(" (view %u)\n"), state_machine_regs.view); else @@ -4782,9 +4710,9 @@ display_debug_lines_raw (struct dwarf_section * section, state_machine_regs.address += uladv; if (uladv) state_machine_regs.view = 0; - printf (_(" Advance PC by %s to 0x%s%s\n"), - dwarf_vmatoa ("u", uladv), - dwarf_vmatoa ("x", state_machine_regs.address), + printf (_(" Advance PC by %" PRIu64 + " to 0x%" PRIx64 "%s\n"), + uladv, state_machine_regs.address, verbose_view && uladv ? _(" (reset view)") : ""); } @@ -4801,9 +4729,9 @@ display_debug_lines_raw (struct dwarf_section * section, % linfo.li_max_ops_per_insn; if (addrdelta) state_machine_regs.view = 0; - printf (_(" Advance PC by %s to 0x%s[%d]%s\n"), - dwarf_vmatoa ("u", uladv), - dwarf_vmatoa ("x", state_machine_regs.address), + printf (_(" Advance PC by %" PRIu64 + " to 0x%" PRIx64 "[%d]%s\n"), + uladv, state_machine_regs.address, state_machine_regs.op_index, verbose_view && addrdelta ? _(" (reset view)") : ""); @@ -4813,29 +4741,27 @@ display_debug_lines_raw (struct dwarf_section * section, case DW_LNS_advance_line: READ_SLEB (adv, data, end); state_machine_regs.line += adv; - printf (_(" Advance Line by %s to %d\n"), - dwarf_vmatoa ("d", adv), - state_machine_regs.line); + printf (_(" Advance Line by %" PRId64 " to %d\n"), + adv, state_machine_regs.line); break; case DW_LNS_set_file: READ_ULEB (uladv, data, end); - printf (_(" Set File Name to entry %s in the File Name Table\n"), - dwarf_vmatoa ("u", uladv)); + printf (_(" Set File Name to entry %" PRIu64 + " in the File Name Table\n"), uladv); state_machine_regs.file = uladv; break; case DW_LNS_set_column: READ_ULEB (uladv, data, end); - printf (_(" Set column to %s\n"), - dwarf_vmatoa ("u", uladv)); + printf (_(" Set column to %" PRIu64 "\n"), uladv); state_machine_regs.column = uladv; break; case DW_LNS_negate_stmt: adv = state_machine_regs.is_stmt; adv = ! adv; - printf (_(" Set is_stmt to %s\n"), dwarf_vmatoa ("d", adv)); + printf (_(" Set is_stmt to %" PRId64 "\n"), adv); state_machine_regs.is_stmt = adv; break; @@ -4852,9 +4778,9 @@ display_debug_lines_raw (struct dwarf_section * section, state_machine_regs.address += uladv; if (uladv) state_machine_regs.view = 0; - printf (_(" Advance PC by constant %s to 0x%s%s\n"), - dwarf_vmatoa ("u", uladv), - dwarf_vmatoa ("x", state_machine_regs.address), + printf (_(" Advance PC by constant %" PRIu64 + " to 0x%" PRIx64 "%s\n"), + uladv, state_machine_regs.address, verbose_view && uladv ? _(" (reset view)") : ""); } @@ -4871,9 +4797,9 @@ display_debug_lines_raw (struct dwarf_section * section, % linfo.li_max_ops_per_insn; if (addrdelta) state_machine_regs.view = 0; - printf (_(" Advance PC by constant %s to 0x%s[%d]%s\n"), - dwarf_vmatoa ("u", uladv), - dwarf_vmatoa ("x", state_machine_regs.address), + printf (_(" Advance PC by constant %" PRIu64 + " to 0x%" PRIx64 "[%d]%s\n"), + uladv, state_machine_regs.address, state_machine_regs.op_index, verbose_view && addrdelta ? _(" (reset view)") : ""); @@ -4884,9 +4810,9 @@ display_debug_lines_raw (struct dwarf_section * section, SAFE_BYTE_GET_AND_INC (uladv, data, 2, end); state_machine_regs.address += uladv; state_machine_regs.op_index = 0; - printf (_(" Advance PC by fixed size amount %s to 0x%s\n"), - dwarf_vmatoa ("u", uladv), - dwarf_vmatoa ("x", state_machine_regs.address)); + printf (_(" Advance PC by fixed size amount %" PRIu64 + " to 0x%" PRIx64 "\n"), + uladv, state_machine_regs.address); /* Do NOT reset view. */ break; @@ -4900,7 +4826,7 @@ display_debug_lines_raw (struct dwarf_section * section, case DW_LNS_set_isa: READ_ULEB (uladv, data, end); - printf (_(" Set ISA to %s\n"), dwarf_vmatoa ("u", uladv)); + printf (_(" Set ISA to %" PRIu64 "\n"), uladv); break; default: @@ -4910,8 +4836,7 @@ display_debug_lines_raw (struct dwarf_section * section, for (i = standard_opcodes[op_code - 1]; i > 0 ; --i) { READ_ULEB (uladv, data, end); - printf ("0x%s%s", dwarf_vmatoa ("x", uladv), - i == 1 ? "" : ", "); + printf ("0x%" PRIx64 "%s", uladv, i == 1 ? "" : ", "); } putchar ('\n'); break; @@ -4955,7 +4880,7 @@ display_debug_lines_decoded (struct dwarf_section * section, File_Entry *file_table = NULL; unsigned int n_files = 0; unsigned char **directory_table = NULL; - dwarf_vma n_directories = 0; + uint64_t n_directories = 0; if (startswith (section->name, ".debug_line.") /* Note: the following does not apply to .debug_line.dwo sections. @@ -5006,7 +4931,7 @@ display_debug_lines_decoded (struct dwarf_section * section, if (linfo.li_version >= 5) { unsigned char *format_start, format_count, *format; - dwarf_vma formati, entryi; + uint64_t formati, entryi; load_debug_section_with_follow (line_str, fileptr); @@ -5042,8 +4967,8 @@ display_debug_lines_decoded (struct dwarf_section * section, format = format_start; for (formati = 0; formati < format_count; formati++) { - dwarf_vma content_type, form; - dwarf_vma uvalue; + uint64_t content_type, form; + uint64_t uvalue; READ_ULEB (content_type, format, end); READ_ULEB (form, format, end); @@ -5116,8 +5041,8 @@ display_debug_lines_decoded (struct dwarf_section * section, format = format_start; for (formati = 0; formati < format_count; formati++) { - dwarf_vma content_type, form; - dwarf_vma uvalue; + uint64_t content_type, form; + uint64_t uvalue; unsigned char *tmp; READ_ULEB (content_type, format, end); @@ -5282,8 +5207,8 @@ display_debug_lines_decoded (struct dwarf_section * section, directory = _("<unknown>"); else if (ix > n_directories) { - warn (_("directory index %u > number of directories %s\n"), - ix, dwarf_vmatoa ("u", n_directories)); + warn (_("directory index %u > number of directories %" PRIu64 "\n"), + ix, n_directories); directory = _("<corrupt>"); } else @@ -5473,8 +5398,8 @@ display_debug_lines_decoded (struct dwarf_section * section, /* PR 20439 */ else if (dir > n_directories) { - warn (_("directory index %u > number of directories %s\n"), - dir, dwarf_vmatoa ("u", n_directories)); + warn (_("directory index %u > number of directories %" PRIu64 "\n"), + dir, n_directories); printf (_("\n <over large directory table entry %u>\n"), dir); } else @@ -5548,11 +5473,10 @@ display_debug_lines_decoded (struct dwarf_section * section, if (standard_opcodes != NULL) for (i = standard_opcodes[op_code - 1]; i > 0 ; --i) { - dwarf_vma val; + uint64_t val; READ_ULEB (val, data, end); - printf ("0x%s%s", dwarf_vmatoa ("x", val), - i == 1 ? "" : ", "); + printf ("0x%" PRIx64 "%s", val, i == 1 ? "" : ", "); } putchar ('\n'); break; @@ -5607,23 +5531,23 @@ display_debug_lines_decoded (struct dwarf_section * section, if (linfo.li_max_ops_per_insn == 1) { if (xop == -DW_LNE_end_sequence) - printf ("%-35s %11s %#18" DWARF_VMA_FMT "x", + printf ("%-35s %11s %#18" PRIx64, newFileName, "-", state_machine_regs.address); else - printf ("%-35s %11d %#18" DWARF_VMA_FMT "x", + printf ("%-35s %11d %#18" PRIx64, newFileName, state_machine_regs.line, state_machine_regs.address); } else { if (xop == -DW_LNE_end_sequence) - printf ("%-35s %11s %#18" DWARF_VMA_FMT "x[%d]", + printf ("%-35s %11s %#18" PRIx64 "[%d]", newFileName, "-", state_machine_regs.address, state_machine_regs.op_index); else - printf ("%-35s %11d %#18" DWARF_VMA_FMT "x[%d]", + printf ("%-35s %11d %#18" PRIx64 "[%d]", newFileName, state_machine_regs.line, state_machine_regs.address, state_machine_regs.op_index); @@ -5634,23 +5558,23 @@ display_debug_lines_decoded (struct dwarf_section * section, if (linfo.li_max_ops_per_insn == 1) { if (xop == -DW_LNE_end_sequence) - printf ("%s %11s %#18" DWARF_VMA_FMT "x", + printf ("%s %11s %#18" PRIx64, newFileName, "-", state_machine_regs.address); else - printf ("%s %11d %#18" DWARF_VMA_FMT "x", + printf ("%s %11d %#18" PRIx64, newFileName, state_machine_regs.line, state_machine_regs.address); } else { if (xop == -DW_LNE_end_sequence) - printf ("%s %11s %#18" DWARF_VMA_FMT "x[%d]", + printf ("%s %11s %#18" PRIx64 "[%d]", newFileName, "-", state_machine_regs.address, state_machine_regs.op_index); else - printf ("%s %11d %#18" DWARF_VMA_FMT "x[%d]", + printf ("%s %11d %#18" PRIx64 "[%d]", newFileName, state_machine_regs.line, state_machine_regs.address, state_machine_regs.op_index); @@ -5726,7 +5650,7 @@ display_debug_lines (struct dwarf_section *section, void *file) } static debug_info * -find_debug_info_for_offset (dwarf_vma offset) +find_debug_info_for_offset (uint64_t offset) { unsigned int i; @@ -5791,10 +5715,9 @@ display_debug_pubnames_worker (struct dwarf_section *section, if (names.pn_length > (size_t) (end - start)) { - warn (_("Debug info is corrupted, %s header at %#lx has length %s\n"), - section->name, - sec_off, - dwarf_vmatoa ("x", names.pn_length)); + warn (_("Debug info is corrupted, " + "%s header at %#lx has length %#" PRIx64 "\n"), + section->name, sec_off, names.pn_length); break; } @@ -5807,19 +5730,20 @@ display_debug_pubnames_worker (struct dwarf_section *section, if (num_debug_info_entries != DEBUG_INFO_UNAVAILABLE && num_debug_info_entries > 0 && find_debug_info_for_offset (names.pn_offset) == NULL) - warn (_(".debug_info offset of 0x%lx in %s section does not point to a CU header.\n"), - (unsigned long) names.pn_offset, section->name); + warn (_(".debug_info offset of %#" PRIx64 + " in %s section does not point to a CU header.\n"), + names.pn_offset, section->name); SAFE_BYTE_GET_AND_INC (names.pn_size, data, offset_size, start); - printf (_(" Length: %ld\n"), - (long) names.pn_length); + printf (_(" Length: %" PRId64 "\n"), + names.pn_length); printf (_(" Version: %d\n"), names.pn_version); - printf (_(" Offset into .debug_info section: 0x%lx\n"), - (unsigned long) names.pn_offset); - printf (_(" Size of area in .debug_info section: %ld\n"), - (long) names.pn_size); + printf (_(" Offset into .debug_info section: 0x%" PRIx64 "\n"), + names.pn_offset); + printf (_(" Size of area in .debug_info section: %" PRId64 "\n"), + names.pn_size); if (names.pn_version != 2 && names.pn_version != 3) { @@ -5842,7 +5766,7 @@ display_debug_pubnames_worker (struct dwarf_section *section, while (1) { size_t maxprint; - dwarf_vma offset; + uint64_t offset; SAFE_BYTE_GET_AND_INC (offset, data, offset_size, start); @@ -5870,13 +5794,13 @@ display_debug_pubnames_worker (struct dwarf_section *section, kind = GDB_INDEX_SYMBOL_KIND_VALUE (kind_data); kind_name = get_gdb_index_symbol_kind_name (kind); is_static = GDB_INDEX_SYMBOL_STATIC_VALUE (kind_data); - printf (" %-6lx %s,%-10s %.*s\n", - (unsigned long) offset, is_static ? _("s") : _("g"), + printf (" %-6" PRIx64 " %s,%-10s %.*s\n", + offset, is_static ? _("s") : _("g"), kind_name, (int) maxprint, data); } else - printf (" %-6lx\t%.*s\n", - (unsigned long) offset, (int) maxprint, data); + printf (" %-6" PRIx64 "\t%.*s\n", + offset, (int) maxprint, data); data += strnlen ((char *) data, maxprint); if (data < start) @@ -5982,15 +5906,15 @@ display_debug_macinfo (struct dwarf_section *section, FILEIDX. Return NULL on failure. */ static unsigned char * -get_line_filename_and_dirname (dwarf_vma line_offset, - dwarf_vma fileidx, +get_line_filename_and_dirname (uint64_t line_offset, + uint64_t fileidx, unsigned char **dir_name) { struct dwarf_section *section = &debug_displays [line].section; unsigned char *hdrptr, *dirtable, *file_name; unsigned int offset_size; unsigned int version, opcode_base; - dwarf_vma length, diridx; + uint64_t length, diridx; const unsigned char * end; *dir_name = NULL; @@ -6103,7 +6027,7 @@ display_debug_macro (struct dwarf_section *section, unsigned int lineno, version, flags; unsigned int offset_size; const unsigned char *string; - dwarf_vma line_offset = 0, sec_offset = curr - start, offset; + uint64_t line_offset = 0, sec_offset = curr - start, offset; unsigned char **extended_ops = NULL; SAFE_BYTE_GET_AND_INC (version, curr, 2, end); @@ -6116,20 +6040,19 @@ display_debug_macro (struct dwarf_section *section, SAFE_BYTE_GET_AND_INC (flags, curr, 1, end); offset_size = (flags & 1) ? 8 : 4; - printf (_(" Offset: 0x%lx\n"), - (unsigned long) sec_offset); + printf (_(" Offset: 0x%" PRIx64 "\n"), sec_offset); printf (_(" Version: %d\n"), version); printf (_(" Offset size: %d\n"), offset_size); if (flags & 2) { SAFE_BYTE_GET_AND_INC (line_offset, curr, offset_size, end); - printf (_(" Offset into .debug_line: 0x%lx\n"), - (unsigned long) line_offset); + printf (_(" Offset into .debug_line: 0x%" PRIx64 "\n"), + line_offset); } if (flags & 4) { unsigned int i, count, op; - dwarf_vma nargs, n; + uint64_t nargs, n; SAFE_BYTE_GET_AND_INC (count, curr, 1, end); @@ -6273,28 +6196,30 @@ display_debug_macro (struct dwarf_section *section, case DW_MACRO_import: SAFE_BYTE_GET_AND_INC (offset, curr, offset_size, end); - printf (_(" DW_MACRO_import - offset : 0x%lx\n"), - (unsigned long) offset); + printf (_(" DW_MACRO_import - offset : 0x%" PRIx64 "\n"), + offset); break; case DW_MACRO_define_sup: READ_ULEB (lineno, curr, end); SAFE_BYTE_GET_AND_INC (offset, curr, offset_size, end); - printf (_(" DW_MACRO_define_sup - lineno : %d macro offset : 0x%lx\n"), - lineno, (unsigned long) offset); + printf (_(" DW_MACRO_define_sup - lineno : %d" + " macro offset : 0x%" PRIx64 "\n"), + lineno, offset); break; case DW_MACRO_undef_sup: READ_ULEB (lineno, curr, end); SAFE_BYTE_GET_AND_INC (offset, curr, offset_size, end); - printf (_(" DW_MACRO_undef_sup - lineno : %d macro offset : 0x%lx\n"), - lineno, (unsigned long) offset); + printf (_(" DW_MACRO_undef_sup - lineno : %d" + " macro offset : 0x%" PRIx64 "\n"), + lineno, offset); break; case DW_MACRO_import_sup: SAFE_BYTE_GET_AND_INC (offset, curr, offset_size, end); - printf (_(" DW_MACRO_import_sup - offset : 0x%lx\n"), - (unsigned long) offset); + printf (_(" DW_MACRO_import_sup - offset : 0x%" PRIx64 "\n"), + offset); break; case DW_MACRO_define_strx: @@ -6308,7 +6233,7 @@ display_debug_macro (struct dwarf_section *section, else printf (" DW_MACRO_undef_strx "); if (do_wide) - printf (_("(with offset %s) "), dwarf_vmatoa ("x", offset)); + printf (_("(with offset %" PRIx64 ") "), offset); printf (_("lineno : %d macro : %s\n"), lineno, string); break; @@ -6328,7 +6253,7 @@ display_debug_macro (struct dwarf_section *section, else { /* Skip over unhandled opcodes. */ - dwarf_vma nargs, n; + uint64_t nargs, n; unsigned char *desc = extended_ops[op]; READ_ULEB (nargs, desc, end); if (nargs == 0) @@ -6375,7 +6300,7 @@ display_debug_abbrev (struct dwarf_section *section, do { - dwarf_vma offset = start - section->start; + uint64_t offset = start - section->start; abbrev_list *list = find_and_process_abbrev_set (section, 0, section->size, offset, NULL); @@ -6383,7 +6308,7 @@ display_debug_abbrev (struct dwarf_section *section, break; if (list->first_abbrev) - printf (_(" Number TAG (0x%lx)\n"), (long) offset); + printf (_(" Number TAG (0x%" PRIx64 ")\n"), offset); for (entry = list->first_abbrev; entry; entry = entry->next) { @@ -6400,7 +6325,7 @@ display_debug_abbrev (struct dwarf_section *section, get_AT_name (attr->attribute), get_FORM_name (attr->form)); if (attr->form == DW_FORM_implicit_const) - printf (": %s", dwarf_vmatoa ("d", attr->implicit_const)); + printf (": %" PRId64, attr->implicit_const); putchar ('\n'); } } @@ -6418,9 +6343,9 @@ display_debug_abbrev (struct dwarf_section *section, POINTER_SIZE bytes long. */ static bool -is_max_address (dwarf_vma addr, unsigned int pointer_size) +is_max_address (uint64_t addr, unsigned int pointer_size) { - dwarf_vma mask = ~(~(dwarf_vma) 1 << (pointer_size * 8 - 1)); + uint64_t mask = ~(~(uint64_t) 0 << 1 << (pointer_size * 8 - 1)); return ((addr & mask) == mask); } @@ -6444,18 +6369,18 @@ display_view_pair_list (struct dwarf_section *section, while (vstart < section_end) { - dwarf_vma off = vstart - section->start; - dwarf_vma vbegin, vend; + uint64_t off = vstart - section->start; + uint64_t vbegin, vend; READ_ULEB (vbegin, vstart, section_end); if (vstart == section_end) break; READ_ULEB (vend, vstart, section_end); - printf (" %8.8lx ", (unsigned long) off); + printf (" %8.8" PRIx64 " ", off); - print_dwarf_view (vbegin, pointer_size, 1); - print_dwarf_view (vend, pointer_size, 1); + print_view (vbegin, pointer_size); + print_view (vend, pointer_size); printf (_("location view pair\n")); } @@ -6469,19 +6394,19 @@ static void display_loc_list (struct dwarf_section *section, unsigned char **start_ptr, unsigned int debug_info_entry, - dwarf_vma offset, - dwarf_vma base_address, + uint64_t offset, + uint64_t base_address, unsigned char **vstart_ptr, int has_frame_base) { unsigned char *start = *start_ptr, *vstart = *vstart_ptr; unsigned char *section_end = section->start + section->size; - dwarf_vma cu_offset; + uint64_t cu_offset; unsigned int pointer_size; unsigned int offset_size; int dwarf_version; - dwarf_vma begin; - dwarf_vma end; + uint64_t begin; + uint64_t end; unsigned short length; int need_frame_base; @@ -6506,18 +6431,18 @@ display_loc_list (struct dwarf_section *section, while (1) { - dwarf_vma off = offset + (start - *start_ptr); - dwarf_vma vbegin = vm1, vend = vm1; + uint64_t off = offset + (start - *start_ptr); + uint64_t vbegin = -1, vend = -1; if (2 * pointer_size > (size_t) (section_end - start)) { - warn (_("Location list starting at offset 0x%lx is not terminated.\n"), - (unsigned long) offset); + warn (_("Location list starting at offset %#" PRIx64 + " is not terminated.\n"), offset); break; } printf (" "); - print_dwarf_vma (off, 4); + print_hex (off, 4); SAFE_BYTE_GET_AND_INC (begin, start, pointer_size, section_end); SAFE_BYTE_GET_AND_INC (end, start, pointer_size, section_end); @@ -6543,8 +6468,8 @@ display_loc_list (struct dwarf_section *section, && !is_max_address (end, pointer_size)) { base_address = end; - print_dwarf_vma (begin, pointer_size); - print_dwarf_vma (end, pointer_size); + print_hex (begin, pointer_size); + print_hex (end, pointer_size); printf (_("(base address)\n")); continue; } @@ -6554,19 +6479,18 @@ display_loc_list (struct dwarf_section *section, off = offset + (vstart - *start_ptr); READ_ULEB (vbegin, vstart, section_end); - print_dwarf_view (vbegin, pointer_size, 1); + print_view (vbegin, pointer_size); READ_ULEB (vend, vstart, section_end); - print_dwarf_view (vend, pointer_size, 1); + print_view (vend, pointer_size); - printf (_("views at %8.8lx for:\n %*s "), - (unsigned long) off, 8, ""); + printf (_("views at %8.8" PRIx64 " for:\n %*s "), off, 8, ""); } if (2 > (size_t) (section_end - start)) { - warn (_("Location list starting at offset 0x%lx is not terminated.\n"), - (unsigned long) offset); + warn (_("Location list starting at offset %#" PRIx64 + " is not terminated.\n"), offset); break; } @@ -6574,13 +6498,13 @@ display_loc_list (struct dwarf_section *section, if (length > (size_t) (section_end - start)) { - warn (_("Location list starting at offset 0x%lx is not terminated.\n"), - (unsigned long) offset); + warn (_("Location list st[...] [diff truncated at 100000 bytes]
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=625d49fce79d6154de07edc00b36335e7e7a0479 commit 625d49fce79d6154de07edc00b36335e7e7a0479 Author: Alan Modra <amodra@gmail.com> Date: Fri Aug 12 17:47:43 2022 +0930 Don't use bfd_vma in readelf.c This replaces bfd_vma with uint64_t in readelf, defines BFD64 unconditionally, removes tests of BFD64 and sizeof (bfd_vma), and removes quite a few now unnecessary casts. Diff: --- binutils/readelf.c | 393 +++++++++++++++++++++++------------------------------ 1 file changed, 172 insertions(+), 221 deletions(-) diff --git a/binutils/readelf.c b/binutils/readelf.c index 577a6a155f6..dc571f9fa20 100644 --- a/binutils/readelf.c +++ b/binutils/readelf.c @@ -50,13 +50,9 @@ #include <msgpack.h> #endif -#if __GNUC__ >= 2 /* Define BFD64 here, even if our default architecture is 32 bit ELF - as this will allow us to read in and parse 64bit and 32bit ELF files. - Only do this if we believe that the compiler can support a 64 bit - data type. For now we only rely on GCC being able to do this. */ + as this will allow us to read in and parse 64bit and 32bit ELF files. */ #define BFD64 -#endif #include "bfd.h" #include "bucomm.h" @@ -287,24 +283,24 @@ typedef struct filedata Elf_Internal_Shdr * dynamic_symtab_section; unsigned long num_dynamic_syms; Elf_Internal_Sym * dynamic_symbols; - bfd_vma version_info[16]; + uint64_t version_info[16]; unsigned int dynamic_syminfo_nent; Elf_Internal_Syminfo * dynamic_syminfo; unsigned long dynamic_syminfo_offset; uint64_t nbuckets; uint64_t nchains; - bfd_vma * buckets; - bfd_vma * chains; + uint64_t * buckets; + uint64_t * chains; uint64_t ngnubuckets; uint64_t ngnuchains; - bfd_vma * gnubuckets; - bfd_vma * gnuchains; - bfd_vma * mipsxlat; - bfd_vma gnusymidx; + uint64_t * gnubuckets; + uint64_t * gnuchains; + uint64_t * mipsxlat; + uint64_t gnusymidx; char * program_interpreter; - bfd_vma dynamic_info[DT_ENCODING]; - bfd_vma dynamic_info_DT_GNU_HASH; - bfd_vma dynamic_info_DT_MIPS_XHASH; + uint64_t dynamic_info[DT_ENCODING]; + uint64_t dynamic_info_DT_GNU_HASH; + uint64_t dynamic_info_DT_MIPS_XHASH; elf_section_list * symtab_shndx_list; size_t group_count; struct group * section_groups; @@ -523,7 +519,7 @@ get_data (void *var, Returns the number of characters displayed. */ static unsigned int -print_vma (bfd_vma vma, print_mode mode) +print_vma (uint64_t vma, print_mode mode) { unsigned int nc = 0; @@ -533,42 +529,40 @@ print_vma (bfd_vma vma, print_mode mode) nc = printf ("0x"); /* Fall through. */ case LONG_HEX: -#ifdef BFD64 if (!is_32bit_elf) - return nc + printf ("%16.16" PRIx64, (uint64_t) vma); -#endif - return nc + printf ("%8.8" PRIx64, (uint64_t) vma); + return nc + printf ("%16.16" PRIx64, vma); + return nc + printf ("%8.8" PRIx64, vma); case DEC_5: if (vma <= 99999) - return printf ("%5" PRId64, (int64_t) vma); + return printf ("%5" PRId64, vma); /* Fall through. */ case PREFIX_HEX: nc = printf ("0x"); /* Fall through. */ case HEX: - return nc + printf ("%" PRIx64, (uint64_t) vma); + return nc + printf ("%" PRIx64, vma); case PREFIX_HEX_5: nc = printf ("0x"); /* Fall through. */ case HEX_5: - return nc + printf ("%05" PRIx64, (uint64_t) vma); + return nc + printf ("%05" PRIx64, vma); case DEC: - return printf ("%" PRId64, (int64_t) (bfd_signed_vma) vma); + return printf ("%" PRId64, vma); case UNSIGNED: - return printf ("%" PRIu64, (uint64_t) vma); + return printf ("%" PRIu64, vma); case UNSIGNED_5: - return printf ("%5" PRIu64, (uint64_t) vma); + return printf ("%5" PRIu64, vma); case OCTAL: - return printf ("%" PRIo64, (uint64_t) vma); + return printf ("%" PRIo64, vma); case OCTAL_5: - return printf ("%5" PRIo64, (uint64_t) vma); + return printf ("%5" PRIo64, vma); default: /* FIXME: Report unrecognised mode ? */ @@ -920,7 +914,7 @@ find_section (Filedata * filedata, const char * name) section exists. */ static Elf_Internal_Shdr * -find_section_by_address (Filedata * filedata, bfd_vma addr) +find_section_by_address (Filedata * filedata, uint64_t addr) { unsigned int i; @@ -1199,10 +1193,6 @@ slurp_rela_relocs (Filedata * filedata, relas[i].r_info = BYTE_GET (erelas[i].r_info); relas[i].r_addend = BYTE_GET_SIGNED (erelas[i].r_addend); - /* The #ifdef BFD64 below is to prevent a compile time - warning. We know that if we do not have a 64 bit data - type that we will never execute this code anyway. */ -#ifdef BFD64 if (filedata->file_header.e_machine == EM_MIPS && filedata->file_header.e_ident[EI_DATA] != ELFDATA2MSB) { @@ -1211,7 +1201,7 @@ slurp_rela_relocs (Filedata * filedata, little-endian symbol index followed by four individual byte fields. Reorder INFO accordingly. */ - bfd_vma inf = relas[i].r_info; + uint64_t inf = relas[i].r_info; inf = (((inf & 0xffffffff) << 32) | ((inf >> 56) & 0xff) | ((inf >> 40) & 0xff00) @@ -1219,7 +1209,6 @@ slurp_rela_relocs (Filedata * filedata, | ((inf >> 8) & 0xff000000)); relas[i].r_info = inf; } -#endif /* BFD64 */ } free (erelas); @@ -1302,10 +1291,6 @@ slurp_rel_relocs (Filedata * filedata, rels[i].r_info = BYTE_GET (erels[i].r_info); rels[i].r_addend = 0; - /* The #ifdef BFD64 below is to prevent a compile time - warning. We know that if we do not have a 64 bit data - type that we will never execute this code anyway. */ -#ifdef BFD64 if (filedata->file_header.e_machine == EM_MIPS && filedata->file_header.e_ident[EI_DATA] != ELFDATA2MSB) { @@ -1314,7 +1299,7 @@ slurp_rel_relocs (Filedata * filedata, little-endian symbol index followed by four individual byte fields. Reorder INFO accordingly. */ - bfd_vma inf = rels[i].r_info; + uint64_t inf = rels[i].r_info; inf = (((inf & 0xffffffff) << 32) | ((inf >> 56) & 0xff) | ((inf >> 40) & 0xff00) @@ -1322,7 +1307,6 @@ slurp_rel_relocs (Filedata * filedata, | ((inf >> 8) & 0xff000000)); rels[i].r_info = inf; } -#endif /* BFD64 */ } free (erels); @@ -1337,12 +1321,12 @@ static bool slurp_relr_relocs (Filedata * filedata, unsigned long relr_offset, unsigned long relr_size, - bfd_vma ** relrsp, + uint64_t ** relrsp, unsigned long * nrelrsp) { void *relrs; size_t size = 0, nentries, i; - bfd_vma base = 0, addr, entry; + uint64_t base = 0, addr, entry; relrs = get_data (NULL, filedata, relr_offset, 1, relr_size, _("RELR relocation data")); @@ -1367,7 +1351,7 @@ slurp_relr_relocs (Filedata * filedata, size++; } - *relrsp = (bfd_vma *) malloc (size * sizeof (bfd_vma)); + *relrsp = malloc (size * sizeof (**relrsp)); if (*relrsp == NULL) { free (relrs); @@ -1378,7 +1362,7 @@ slurp_relr_relocs (Filedata * filedata, size = 0; for (i = 0; i < nentries; i++) { - const bfd_vma entry_bytes = is_32bit_elf ? 4 : 8; + const uint64_t entry_bytes = is_32bit_elf ? 4 : 8; if (is_32bit_elf) entry = BYTE_GET (((Elf32_External_Relr *)relrs)[i].r_data); @@ -1406,7 +1390,7 @@ slurp_relr_relocs (Filedata * filedata, /* Returns the reloc type extracted from the reloc info field. */ static unsigned int -get_reloc_type (Filedata * filedata, bfd_vma reloc_info) +get_reloc_type (Filedata * filedata, uint64_t reloc_info) { if (is_32bit_elf) return ELF32_R_TYPE (reloc_info); @@ -1427,8 +1411,8 @@ get_reloc_type (Filedata * filedata, bfd_vma reloc_info) /* Return the symbol index extracted from the reloc info field. */ -static bfd_vma -get_reloc_symindex (bfd_vma reloc_info) +static uint64_t +get_reloc_symindex (uint64_t reloc_info) { return is_32bit_elf ? ELF32_R_SYM (reloc_info) : ELF64_R_SYM (reloc_info); } @@ -1477,7 +1461,7 @@ dump_relocations (Filedata * filedata, } else if (rel_type == reltype_relr) { - bfd_vma * relrs; + uint64_t * relrs; const char *format = is_32bit_elf ? "%08" PRIx64 "\n" : "%016" PRIx64 "\n"; @@ -1488,7 +1472,7 @@ dump_relocations (Filedata * filedata, printf (ngettext (" %lu offset\n", " %lu offsets\n", rel_size), rel_size); for (i = 0; i < rel_size; i++) - printf (format, (uint64_t) relrs[i]); + printf (format, relrs[i]); free (relrs); return true; } @@ -1531,10 +1515,10 @@ dump_relocations (Filedata * filedata, for (i = 0; i < rel_size; i++) { const char * rtype; - bfd_vma offset; - bfd_vma inf; - bfd_vma symtab_index; - bfd_vma type; + uint64_t offset; + uint64_t inf; + uint64_t symtab_index; + uint64_t type; offset = rels[i].r_offset; inf = rels[i].r_info; @@ -1553,7 +1537,7 @@ dump_relocations (Filedata * filedata, printf (do_wide ? "%16.16" PRIx64 " %16.16" PRIx64 " " : "%12.12" PRIx64 " %12.12" PRIx64 " ", - (uint64_t) offset, (uint64_t) inf); + offset, inf); } switch (filedata->file_header.e_machine) @@ -2055,24 +2039,24 @@ dump_relocations (Filedata * filedata, if (rel_type == reltype_rela) { - bfd_vma off = rels[i].r_addend; + uint64_t off = rels[i].r_addend; - if ((bfd_signed_vma) off < 0) - printf (" - %" PRIx64, (uint64_t) -off); + if ((int64_t) off < 0) + printf (" - %" PRIx64, -off); else - printf (" + %" PRIx64, (uint64_t) off); + printf (" + %" PRIx64, off); } } } else if (rel_type == reltype_rela) { - bfd_vma off = rels[i].r_addend; + uint64_t off = rels[i].r_addend; printf ("%*c", is_32bit_elf ? 12 : 20, ' '); - if ((bfd_signed_vma) off < 0) - printf ("-%" PRIx64, (uint64_t) -off); + if ((int64_t) off < 0) + printf ("-%" PRIx64, -off); else - printf ("%" PRIx64, (uint64_t) off); + printf ("%" PRIx64, off); } if (filedata->file_header.e_machine == EM_SPARCV9 @@ -2082,11 +2066,10 @@ dump_relocations (Filedata * filedata, putchar ('\n'); -#ifdef BFD64 if (! is_32bit_elf && filedata->file_header.e_machine == EM_MIPS) { - bfd_vma type2 = ELF64_MIPS_R_TYPE2 (inf); - bfd_vma type3 = ELF64_MIPS_R_TYPE3 (inf); + uint64_t type2 = ELF64_MIPS_R_TYPE2 (inf); + uint64_t type3 = ELF64_MIPS_R_TYPE3 (inf); const char * rtype2 = elf_mips_reloc_type (type2); const char * rtype3 = elf_mips_reloc_type (type3); @@ -2108,7 +2091,6 @@ dump_relocations (Filedata * filedata, putchar ('\n'); } -#endif /* BFD64 */ } free (rels); @@ -6001,14 +5983,14 @@ process_program_headers (Filedata * filedata) else printf (_("\nElf file type is %s\n"), get_file_type (filedata)); printf (_("Entry point 0x%" PRIx64 "\n"), - (uint64_t) filedata->file_header.e_entry); + filedata->file_header.e_entry); printf (ngettext ("There is %d program header," " starting at offset %" PRIu64 "\n", "There are %d program headers," " starting at offset %" PRIu64 "\n", filedata->file_header.e_phnum), filedata->file_header.e_phnum, - (uint64_t) filedata->file_header.e_phoff); + filedata->file_header.e_phoff); } if (! get_program_headers (filedata)) @@ -6285,7 +6267,7 @@ the .dynamic section is not the same as the dynamic segment\n")); /* Find the file offset corresponding to VMA by using the program headers. */ static long -offset_from_vma (Filedata * filedata, bfd_vma vma, uint64_t size) +offset_from_vma (Filedata * filedata, uint64_t vma, uint64_t size) { Elf_Internal_Phdr * seg; @@ -6704,16 +6686,16 @@ get_elf_symbols (Filedata *filedata, } static const char * -get_elf_section_flags (Filedata * filedata, bfd_vma sh_flags) +get_elf_section_flags (Filedata * filedata, uint64_t sh_flags) { static char buff[1024]; char * p = buff; unsigned int field_size = is_32bit_elf ? 8 : 16; signed int sindex; unsigned int size = sizeof (buff) - (field_size + 4 + 1); - bfd_vma os_flags = 0; - bfd_vma proc_flags = 0; - bfd_vma unknown_flags = 0; + uint64_t os_flags = 0; + uint64_t proc_flags = 0; + uint64_t unknown_flags = 0; static const struct { const char * str; @@ -6767,7 +6749,7 @@ get_elf_section_flags (Filedata * filedata, bfd_vma sh_flags) while (sh_flags) { - bfd_vma flag; + uint64_t flag; flag = sh_flags & - sh_flags; sh_flags &= ~ flag; @@ -6798,7 +6780,6 @@ get_elf_section_flags (Filedata * filedata, bfd_vma sh_flags) sindex = 10; else if (flag == SHF_IA_64_NORECOV) sindex = 11; -#ifdef BFD64 else if (filedata->file_header.e_ident[EI_OSABI] == ELFOSABI_OPENVMS) switch (flag) { @@ -6810,7 +6791,6 @@ get_elf_section_flags (Filedata * filedata, bfd_vma sh_flags) case SHF_IA_64_VMS_PROTECTED: sindex = 17; break; default: break; } -#endif break; case EM_386: @@ -7166,7 +7146,7 @@ process_section_headers (Filedata * filedata) if (section->sh_entsize != expected_entsize) \ { \ error (_("Section %d has invalid sh_entsize of %" PRIx64 "\n"), \ - i, (uint64_t) section->sh_entsize); \ + i, section->sh_entsize); \ error (_("(Using the expected size of %" PRIx64 " for the rest of this dump)\n"), \ expected_entsize); \ section->sh_entsize = expected_entsize; \ @@ -8100,19 +8080,19 @@ process_section_groups (Filedata * filedata) struct ia64_vms_dynfixup { - bfd_vma needed_ident; /* Library ident number. */ - bfd_vma needed; /* Index in the dstrtab of the library name. */ - bfd_vma fixup_needed; /* Index of the library. */ - bfd_vma fixup_rela_cnt; /* Number of fixups. */ - bfd_vma fixup_rela_off; /* Fixups offset in the dynamic segment. */ + uint64_t needed_ident; /* Library ident number. */ + uint64_t needed; /* Index in the dstrtab of the library name. */ + uint64_t fixup_needed; /* Index of the library. */ + uint64_t fixup_rela_cnt; /* Number of fixups. */ + uint64_t fixup_rela_off; /* Fixups offset in the dynamic segment. */ }; /* Data used to display dynamic relocations. */ struct ia64_vms_dynimgrela { - bfd_vma img_rela_cnt; /* Number of relocations. */ - bfd_vma img_rela_off; /* Reloc offset in the dynamic segment. */ + uint64_t img_rela_cnt; /* Number of relocations. */ + uint64_t img_rela_off; /* Reloc offset in the dynamic segment. */ }; /* Display IA-64 OpenVMS dynamic fixups (used to dynamically link a shared @@ -8155,7 +8135,7 @@ dump_ia64_vms_dynamic_fixups (Filedata * filedata, const char *rtype; printf ("%3u ", (unsigned) BYTE_GET (imfs [i].fixup_seg)); - printf ("%016" PRIx64 " ", (uint64_t) BYTE_GET (imfs [i].fixup_offset)); + printf ("%016" PRIx64 " ", BYTE_GET (imfs [i].fixup_offset)); type = BYTE_GET (imfs [i].type); rtype = elf_ia64_reloc_type (type); if (rtype == NULL) @@ -8195,8 +8175,7 @@ dump_ia64_vms_dynamic_relocs (Filedata * filedata, struct ia64_vms_dynimgrela *i const char *rtype; printf ("%3u ", (unsigned) BYTE_GET (imrs [i].rela_seg)); - printf ("%08" PRIx64 " ", - (uint64_t) BYTE_GET (imrs [i].rela_offset)); + printf ("%08" PRIx64 " ", BYTE_GET (imrs [i].rela_offset)); type = BYTE_GET (imrs [i].type); rtype = elf_ia64_reloc_type (type); if (rtype == NULL) @@ -8205,8 +8184,7 @@ dump_ia64_vms_dynamic_relocs (Filedata * filedata, struct ia64_vms_dynimgrela *i printf ("%-31s ", rtype); print_vma (BYTE_GET (imrs [i].addend), FULL_HEX); printf ("%3u ", (unsigned) BYTE_GET (imrs [i].sym_seg)); - printf ("%08" PRIx64 "\n", - (uint64_t) BYTE_GET (imrs [i].sym_offset)); + printf ("%08" PRIx64 "\n", BYTE_GET (imrs [i].sym_offset)); } free (imrs); @@ -8221,8 +8199,8 @@ process_ia64_vms_dynamic_relocs (Filedata * filedata) struct ia64_vms_dynfixup fixup; struct ia64_vms_dynimgrela imgrela; Elf_Internal_Dyn *entry; - bfd_vma strtab_off = 0; - bfd_vma strtab_sz = 0; + uint64_t strtab_off = 0; + uint64_t strtab_sz = 0; char *strtab = NULL; bool res = true; @@ -8493,7 +8471,7 @@ process_relocs (Filedata * filedata) struct absaddr { unsigned short section; - bfd_vma offset; + uint64_t offset; }; /* Find the nearest symbol at or below ADDR. Returns the symbol @@ -8507,9 +8485,9 @@ find_symbol_for_address (Filedata * filedata, unsigned long strtab_size, struct absaddr addr, const char ** symname, - bfd_vma * offset) + uint64_t * offset) { - bfd_vma dist = 0x100000; + uint64_t dist = 0x100000; Elf_Internal_Sym * sym; Elf_Internal_Sym * beg; Elf_Internal_Sym * end; @@ -8521,7 +8499,7 @@ find_symbol_for_address (Filedata * filedata, while (beg < end) { - bfd_vma value; + uint64_t value; sym = beg + (end - beg) / 2; @@ -8583,8 +8561,8 @@ struct ia64_unw_aux_info unsigned long table_len; /* Length of unwind table. */ unsigned char * info; /* Unwind info. */ unsigned long info_size; /* Size of unwind info. */ - bfd_vma info_addr; /* Starting address of unwind info. */ - bfd_vma seg_base; /* Starting address of segment. */ + uint64_t info_addr; /* Starting address of unwind info. */ + uint64_t seg_base; /* Starting address of segment. */ Elf_Internal_Sym * symtab; /* The symbol table. */ unsigned long nsyms; /* Number of symbols. */ Elf_Internal_Sym * funtab; /* Sorted table of STT_FUNC symbols. */ @@ -8610,8 +8588,8 @@ dump_ia64_unwind (Filedata * filedata, struct ia64_unw_aux_info * aux) for (tp = aux->table; tp < aux->table + aux->table_len; ++tp) { - bfd_vma stamp; - bfd_vma offset; + uint64_t stamp; + uint64_t offset; const unsigned char * dp; const unsigned char * head; const unsigned char * end; @@ -9045,7 +9023,7 @@ struct hppa_unw_aux_info { struct hppa_unw_table_entry * table; /* Unwind table. */ unsigned long table_len; /* Length of unwind table. */ - bfd_vma seg_base; /* Starting address of segment. */ + uint64_t seg_base; /* Starting address of segment. */ Elf_Internal_Sym * symtab; /* The symbol table. */ unsigned long nsyms; /* Number of symbols. */ Elf_Internal_Sym * funtab; /* Sorted table of STT_FUNC symbols. */ @@ -9070,7 +9048,7 @@ dump_hppa_unwind (Filedata * filedata, struct hppa_unw_aux_info * aux) for (tp = aux->table; tp < aux->table + aux->table_len; ++tp) { - bfd_vma offset; + uint64_t offset; const char * procname; find_symbol_for_address (filedata, aux->funtab, aux->nfuns, aux->strtab, @@ -9405,11 +9383,11 @@ struct arm_unw_aux_info static const char * arm_print_vma_and_name (Filedata * filedata, struct arm_unw_aux_info * aux, - bfd_vma fn, + uint64_t fn, struct absaddr addr) { const char *procname; - bfd_vma sym_offset; + uint64_t sym_offset; if (addr.section == SHN_UNDEF) addr.offset = fn; @@ -9456,10 +9434,10 @@ get_unwind_section_word (Filedata * filedata, struct arm_unw_aux_info * aux, struct arm_section * arm_sec, Elf_Internal_Shdr * sec, - bfd_vma word_offset, + uint64_t word_offset, unsigned int * wordp, struct absaddr * addr, - bfd_vma * sym_name) + uint64_t * sym_name) { Elf_Internal_Rela *rp; Elf_Internal_Sym *sym; @@ -9474,7 +9452,7 @@ get_unwind_section_word (Filedata * filedata, addr->offset = 0; if (sym_name != NULL) - *sym_name = (bfd_vma) -1; + *sym_name = (uint64_t) -1; /* If necessary, update the section cache. */ if (sec != arm_sec->sec) @@ -9528,8 +9506,7 @@ get_unwind_section_word (Filedata * filedata, /* If the offset is invalid then fail. */ if (/* PR 21343 *//* PR 18879 */ sec->sh_size < 4 - || word_offset > (sec->sh_size - 4) - || ((bfd_signed_vma) word_offset) < 0) + || word_offset > sec->sh_size - 4) return false; /* Get the word at the required offset. */ @@ -9546,7 +9523,7 @@ get_unwind_section_word (Filedata * filedata, wrapped = false; for (rp = arm_sec->next_rela; rp != arm_sec->rela + arm_sec->nrelas; rp++) { - bfd_vma prelval, offset; + uint64_t prelval, offset; if (rp->r_offset > word_offset && !wrapped) { @@ -9574,7 +9551,7 @@ get_unwind_section_word (Filedata * filedata, { offset = word & 0x7fffffff; if (offset & 0x40000000) - offset |= ~ (bfd_vma) 0x7fffffff; + offset |= ~ (uint64_t) 0x7fffffff; } else if (arm_sec->rel_type == SHT_RELA) offset = rp->r_addend; @@ -9645,7 +9622,7 @@ get_unwind_section_word (Filedata * filedata, break; } - word = (word & ~ (bfd_vma) 0x7fffffff) | (prelval & 0x7fffffff); + word = (word & ~ (uint64_t) 0x7fffffff) | (prelval & 0x7fffffff); addr->section = sym->st_shndx; addr->offset = offset; @@ -9715,7 +9692,7 @@ decode_arm_unwind_bytecode (Filedata * filedata, unsigned int word, unsigned int remaining, unsigned int more_words, - bfd_vma data_offset, + uint64_t data_offset, Elf_Internal_Shdr * data_sec, struct arm_section * data_arm_sec) { @@ -9941,7 +9918,7 @@ decode_tic6x_unwind_bytecode (Filedata * filedata, unsigned int word, unsigned int remaining, unsigned int more_words, - bfd_vma data_offset, + uint64_t data_offset, Elf_Internal_Shdr * data_sec, struct arm_section * data_arm_sec) { @@ -10090,14 +10067,14 @@ decode_tic6x_unwind_bytecode (Filedata * filedata, return true; } -static bfd_vma -arm_expand_prel31 (Filedata * filedata, bfd_vma word, bfd_vma where) +static uint64_t +arm_expand_prel31 (Filedata * filedata, uint64_t word, uint64_t where) { - bfd_vma offset; + uint64_t offset; offset = word & 0x7fffffff; if (offset & 0x40000000) - offset |= ~ (bfd_vma) 0x7fffffff; + offset |= ~ (uint64_t) 0x7fffffff; if (filedata->file_header.e_machine == EM_TI_C6000) offset <<= 1; @@ -10110,14 +10087,14 @@ decode_arm_unwind (Filedata * filedata, struct arm_unw_aux_info * aux, unsigned int word, unsigned int remaining, - bfd_vma data_offset, + uint64_t data_offset, Elf_Internal_Shdr * data_sec, struct arm_section * data_arm_sec) { int per_index; unsigned int more_words = 0; struct absaddr addr; - bfd_vma sym_name = (bfd_vma) -1; + uint64_t sym_name = (uint64_t) -1; bool res = true; if (remaining == 0) @@ -10142,14 +10119,14 @@ decode_arm_unwind (Filedata * filedata, if ((word & 0x80000000) == 0) { /* Expand prel31 for personality routine. */ - bfd_vma fn; + uint64_t fn; const char *procname; fn = arm_expand_prel31 (filedata, word, data_sec->sh_addr + data_offset); printf (_(" Personality routine: ")); if (fn == 0 && addr.section == SHN_UNDEF && addr.offset == 0 - && sym_name != (bfd_vma) -1 && sym_name < aux->strtab_size) + && sym_name != (uint64_t) -1 && sym_name < aux->strtab_size) { procname = aux->strtab + sym_name; print_vma (fn, PREFIX_HEX); @@ -10300,7 +10277,7 @@ dump_arm_unwind (Filedata * filedata, { unsigned int exidx_fn, exidx_entry; struct absaddr fn_addr, entry_addr; - bfd_vma fn; + uint64_t fn; fputc ('\n', stdout); @@ -10342,7 +10319,7 @@ dump_arm_unwind (Filedata * filedata, } else { - bfd_vma table, table_offset = 0; + uint64_t table, table_offset = 0; Elf_Internal_Shdr *table_sec; fputs ("@", stdout); @@ -10357,8 +10334,7 @@ dump_arm_unwind (Filedata * filedata, table_sec = filedata->section_headers + entry_addr.section; table_offset = entry_addr.offset; /* PR 18879 */ - if (table_offset > table_sec->sh_size - || ((bfd_signed_vma) table_offset) < 0) + if (table_offset > table_sec->sh_size) { warn (_("Unwind entry contains corrupt offset (0x%lx) into section %s\n"), (unsigned long) table_offset, @@ -10568,7 +10544,7 @@ dynamic_section_mips_val (Filedata * filedata, Elf_Internal_Dyn * entry) get_dynamic_name (filedata, entry->d_un.d_val)); else printf (_("Interface Version: <corrupt: %" PRIx64 ">"), - (uint64_t) entry->d_un.d_ptr); + entry->d_un.d_ptr); break; case DT_MIPS_TIME_STAMP: @@ -10650,7 +10626,7 @@ dynamic_section_parisc_val (Elf_Internal_Dyn * entry) }; bool first = true; size_t cnt; - bfd_vma val = entry->d_un.d_val; + uint64_t val = entry->d_un.d_val; for (cnt = 0; cnt < ARRAY_SIZE (flags); ++cnt) if (val & flags[cnt].bit) @@ -10678,8 +10654,6 @@ dynamic_section_parisc_val (Elf_Internal_Dyn * entry) putchar ('\n'); } -#ifdef BFD64 - /* VMS vs Unix time offset and factor. */ #define VMS_EPOCH_OFFSET 35067168000000000LL @@ -10708,7 +10682,6 @@ print_vms_time (int64_t vmstime) tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec); } -#endif /* BFD64 */ static void dynamic_section_ia64_val (Elf_Internal_Dyn * entry) @@ -10723,9 +10696,7 @@ dynamic_section_ia64_val (Elf_Internal_Dyn * entry) break; case DT_IA_64_VMS_LINKTIME: -#ifdef BFD64 print_vms_time (entry->d_un.d_val); -#endif break; case DT_IA_64_VMS_LNKFLAGS: @@ -10883,13 +10854,13 @@ get_dynamic_section (Filedata *filedata) } static void -print_dynamic_flags (bfd_vma flags) +print_dynamic_flags (uint64_t flags) { bool first = true; while (flags) { - bfd_vma flag; + uint64_t flag; flag = flags & - flags; flags &= ~ flag; @@ -10912,11 +10883,11 @@ print_dynamic_flags (bfd_vma flags) puts (""); } -static bfd_vma * +static uint64_t * get_dynamic_data (Filedata * filedata, uint64_t number, unsigned int ent_size) { unsigned char * e_data; - bfd_vma * i_data; + uint64_t * i_data; /* If size_t is smaller than uint64_t, eg because you are building on a 32-bit host, then make sure that when number is cast to @@ -10955,7 +10926,7 @@ get_dynamic_data (Filedata * filedata, uint64_t number, unsigned int ent_size) return NULL; } - i_data = (bfd_vma *) cmalloc ((size_t) number, sizeof (*i_data)); + i_data = (uint64_t *) cmalloc ((size_t) number, sizeof (*i_data)); if (i_data == NULL) { error (_("Out of memory allocating space for %" PRIu64 " dynamic entries\n"), @@ -11041,8 +11012,8 @@ get_num_dynamic_syms (Filedata * filedata) if (filedata->dynamic_info_DT_GNU_HASH) { unsigned char nb[16]; - bfd_vma i, maxchain = 0xffffffff, bitmaskwords; - bfd_vma buckets_vma; + uint64_t i, maxchain = 0xffffffff, bitmaskwords; + uint64_t buckets_vma; unsigned long hn; if (fseek (filedata->handle, @@ -11166,8 +11137,8 @@ get_num_dynamic_syms (Filedata * filedata) for (hn = 0; hn < filedata->ngnubuckets; ++hn) if (filedata->gnubuckets[hn] != 0) { - bfd_vma si = filedata->gnubuckets[hn]; - bfd_vma off = si - filedata->gnusymidx; + uint64_t si = filedata->gnubuckets[hn]; + uint64_t off = si - filedata->gnusymidx; do { @@ -11261,7 +11232,7 @@ process_dynamic_section (Filedata * filedata) && filedata->dynamic_info[DT_SYMENT]) { Elf_Internal_Phdr *seg; - bfd_vma vma = filedata->dynamic_info[DT_SYMTAB]; + uint64_t vma = filedata->dynamic_info[DT_SYMTAB]; if (! get_program_headers (filedata)) { @@ -12055,7 +12026,7 @@ process_version_sections (Filedata * filedata) printable_section_name (filedata, section), section->sh_info); - printf (_(" Addr: 0x%016" PRIx64), (uint64_t) section->sh_addr); + printf (_(" Addr: 0x%016" PRIx64), section->sh_addr); printf (_(" Offset: %#08lx Link: %u (%s)\n"), (unsigned long) section->sh_offset, section->sh_link, printable_section_name_from_index (filedata, section->sh_link)); @@ -12201,7 +12172,7 @@ process_version_sections (Filedata * filedata) printable_section_name (filedata, section), section->sh_info); - printf (_(" Addr: 0x%016" PRIx64), (uint64_t) section->sh_addr); + printf (_(" Addr: 0x%016" PRIx64), section->sh_addr); printf (_(" Offset: %#08lx Link: %u (%s)\n"), (unsigned long) section->sh_offset, section->sh_link, printable_section_name_from_index (filedata, section->sh_link)); @@ -12366,7 +12337,7 @@ process_version_sections (Filedata * filedata) printable_section_name (filedata, section), (unsigned long) total); - printf (_(" Addr: 0x%016" PRIx64), (uint64_t) section->sh_addr); + printf (_(" Addr: 0x%016" PRIx64), section->sh_addr); printf (_(" Offset: %#08lx Link: %u (%s)\n"), (unsigned long) section->sh_offset, section->sh_link, printable_section_name (filedata, link_section)); @@ -13098,7 +13069,7 @@ get_symbol_version_string (Filedata * filedata, /* Display a symbol size on stdout. Format is based on --sym-base setting. */ static unsigned int -print_dynamic_symbol_size (bfd_vma vma, int base) +print_dynamic_symbol_size (uint64_t vma, int base) { switch (base) { @@ -13605,7 +13576,7 @@ process_symbol_table (Filedata * filedata) unsigned long * lengths; unsigned long * counts; unsigned long hn; - bfd_vma si; + uint64_t si; unsigned long maxlength = 0; unsigned long nzero_counts = 0; unsigned long nsyms = 0; @@ -13711,7 +13682,7 @@ process_symbol_table (Filedata * filedata) for (hn = 0; hn < filedata->ngnubuckets; ++hn) if (filedata->gnubuckets[hn] != 0) { - bfd_vma off, length = 1; + uint64_t off, length = 1; for (off = filedata->gnubuckets[hn] - filedata->gnusymidx; /* PR 17531 file: 010-77222-0.004. */ @@ -13946,7 +13917,7 @@ target_specific_reloc_handling (Filedata * filedata, handle_sym_diff: if (saved_sym != NULL) { - bfd_vma value; + uint64_t value; unsigned int reloc_size = 0; int leb_ret = 0; switch (reloc_type) @@ -14026,7 +13997,7 @@ target_specific_reloc_handling (Filedata * filedata, if (saved_sym != NULL) { int reloc_size = reloc_type == 1 ? 4 : 2; - bfd_vma value; + uint64_t value; if (sym_index >= num_syms) error (_("MN10300 reloc contains invalid symbol index %lu\n"), @@ -14057,9 +14028,9 @@ target_specific_reloc_handling (Filedata * filedata, case EM_RL78: { - static bfd_vma saved_sym1 = 0; - static bfd_vma saved_sym2 = 0; - static bfd_vma value; + static uint64_t saved_sym1 = 0; + static uint64_t saved_sym2 = 0; + static uint64_t value; if (reloc == NULL) { @@ -14934,7 +14905,7 @@ apply_relocations (Filedata *filedata, for (rp = relocs; rp < relocs + num_relocs; ++rp) { - bfd_vma addend; + uint64_t addend; unsigned int reloc_type; unsigned int reloc_size; bool reloc_inplace = false; @@ -15421,7 +15392,7 @@ dump_section_as_bytes (Elf_Internal_Shdr *section, Elf_Internal_Shdr *relsec; size_t bytes; uint64_t section_size; - bfd_vma addr; + uint64_t addr; unsigned char *data; unsigned char *real_start; unsigned char *start; @@ -15935,9 +15906,9 @@ get_build_id (void * data) Elf_External_Note * enote; Elf_Internal_Note inote; - bfd_vma offset = shdr->sh_offset; - bfd_vma align = shdr->sh_addralign; - bfd_vma length = shdr->sh_size; + uint64_t offset = shdr->sh_offset; + uint64_t align = shdr->sh_addralign; + uint64_t length = shdr->sh_size; enote = (Elf_External_Note *) get_section_contents (shdr, filedata); if (enote == NULL) @@ -17886,14 +17857,14 @@ process_attributes (Filedata * filedata, } else { - bfd_vma section_len; + uint64_t section_len; section_len = sect->sh_size - 1; p++; while (section_len > 0) { - bfd_vma attr_len; + uint64_t attr_len; unsigned int namelen; bool public_section; bool gnu_section; @@ -17954,7 +17925,7 @@ process_attributes (Filedata * filedata, { int tag; unsigned int val; - bfd_vma size; + uint64_t size; unsigned char * end; /* PR binutils/17531: Safe handling of corrupt files. */ @@ -18054,8 +18025,8 @@ process_attributes (Filedata * filedata, and return the VMA of the next entry, or -1 if there was a problem. Does not read from DATA_END or beyond. */ -static bfd_vma -print_mips_got_entry (unsigned char * data, bfd_vma pltgot, bfd_vma addr, +static uint64_t +print_mips_got_entry (unsigned char * data, uint64_t pltgot, uint64_t addr, unsigned char * data_end) { printf (" "); @@ -18070,14 +18041,14 @@ print_mips_got_entry (unsigned char * data, bfd_vma pltgot, bfd_vma addr, printf ("%*s", is_32bit_elf ? 8 : 16, _("<unknown>")); else { - bfd_vma entry; + uint64_t entry; unsigned char * from = data + addr - pltgot; if (from + (is_32bit_elf ? 4 : 8) > data_end) { warn (_("MIPS GOT entry extends beyond the end of available data\n")); printf ("%*s", is_32bit_elf ? 8 : 16, _("<corrupt>")); - return (bfd_vma) -1; + return (uint64_t) -1; } else { @@ -18092,8 +18063,8 @@ print_mips_got_entry (unsigned char * data, bfd_vma pltgot, bfd_vma addr, PLTGOT. Print the Address and Initial fields of an entry at VMA ADDR and return the VMA of the next entry. */ -static bfd_vma -print_mips_pltgot_entry (unsigned char * data, bfd_vma pltgot, bfd_vma addr) +static uint64_t +print_mips_pltgot_entry (unsigned char * data, uint64_t pltgot, uint64_t addr) { printf (" "); print_vma (addr, LONG_HEX); @@ -18102,7 +18073,7 @@ print_mips_pltgot_entry (unsigned char * data, bfd_vma pltgot, bfd_vma addr) printf ("%*s", is_32bit_elf ? 8 : 16, _("<unknown>")); else { - bfd_vma entry; + uint64_t entry; entry = byte_get (data + addr - pltgot, is_32bit_elf ? 4 : 8); print_vma (entry, LONG_HEX); @@ -18253,12 +18224,12 @@ process_mips_specific (Filedata * filedata) size_t conflicts_offset = 0; size_t pltrelsz = 0; size_t pltrel = 0; - bfd_vma pltgot = 0; - bfd_vma mips_pltgot = 0; - bfd_vma jmprel = 0; - bfd_vma local_gotno = 0; - bfd_vma gotsym = 0; - bfd_vma symtabno = 0; + uint64_t pltgot = 0; + uint64_t mips_pltgot = 0; + uint64_t jmprel = 0; + uint64_t local_gotno = 0; + uint64_t gotsym = 0; + uint64_t symtabno = 0; bool res = true; if (! process_attributes (filedata, NULL, SHT_GNU_ATTRIBUTES, NULL, @@ -18328,7 +18299,7 @@ process_mips_specific (Filedata * filedata) { unsigned char *data_end; unsigned char *data; - bfd_vma ent, end; + uint64_t ent, end; int addr_size; pltgot = sect->sh_addr; @@ -18364,7 +18335,7 @@ process_mips_specific (Filedata * filedata) addr_size * 2, _("Value")); ent = print_mips_got_entry (data, pltgot, ent, data_end); printf ("\n"); - if (ent == (bfd_vma) -1) + if (ent == (uint64_t) -1) goto sgot_print_fail; /* Check for the MSB of GOT[1] being set, identifying a @@ -18380,7 +18351,7 @@ process_mips_specific (Filedata * filedata) { ent = print_mips_got_entry (data, pltgot, ent, data_end); printf ("\n"); - if (ent == (bfd_vma) -1) + if (ent == (uint64_t) -1) goto sgot_print_fail; } printf ("\n"); @@ -18396,7 +18367,7 @@ process_mips_specific (Filedata * filedata) { ent = print_mips_got_entry (data, pltgot, ent, data_end); printf ("\n"); - if (ent == (bfd_vma) -1) + if (ent == (uint64_t) -1) goto sgot_print_fail; } printf ("\n"); @@ -18892,7 +18863,7 @@ process_mips_specific (Filedata * filedata) if (pltgot != 0 && local_gotno != 0) { - bfd_vma ent, local_end, global_end; + uint64_t ent, local_end, global_end; size_t i, offset; unsigned char * data; unsigned char * data_end; @@ -18936,7 +18907,7 @@ process_mips_specific (Filedata * filedata) addr_size * 2, _("Initial")); ent = print_mips_got_entry (data, pltgot, ent, data_end); printf (_(" Lazy resolver\n")); - if (ent == (bfd_vma) -1) + if (ent == (uint64_t) -1) goto got_print_fail; /* Check for the MSB of GOT[1] being set, denoting a GNU object. @@ -18951,7 +18922,7 @@ process_mips_specific (Filedata * filedata) { ent = print_mips_got_entry (data, pltgot, ent, data_end); printf (_(" Module pointer (GNU extension)\n")); - if (ent == (bfd_vma) -1) + if (ent == (uint64_t) -1) goto got_print_fail; } printf ("\n"); @@ -18966,7 +18937,7 @@ process_mips_specific (Filedata * filedata) { ent = print_mips_got_entry (data, pltgot, ent, data_end); printf ("\n"); - if (ent == (bfd_vma) -1) + if (ent == (uint64_t) -1) goto got_print_fail; } printf ("\n"); @@ -19015,7 +18986,7 @@ process_mips_specific (Filedata * filedata) (unsigned long) i); printf ("\n"); - if (ent == (bfd_vma) -1) + if (ent == (uint64_t) -1) break; } printf ("\n"); @@ -19027,7 +18998,7 @@ process_mips_specific (Filedata * filedata) if (mips_pltgot != 0 && jmprel != 0 && pltrel != 0 && pltrelsz != 0) { - bfd_vma ent, end; + uint64_t ent, end; size_t offset, rel_offset; unsigned long count, i; unsigned char * data; @@ -19405,7 +19376,7 @@ static bool print_core_note (Elf_Internal_Note *pnote) { unsigned int addr_size = is_32bit_elf ? 4 : 8; - bfd_vma count, page_size; + uint64_t count, page_size; unsigned char *descdata, *filenames, *descend; if (pnote->type != NT_FILE) @@ -19415,14 +19386,12 @@ print_core_note (Elf_Internal_Note *pnote) return true; } -#ifndef BFD64 if (!is_32bit_elf) { printf (_(" Cannot decode 64-bit note in 32-bit build\n")); /* Still "successful". */ return true; } -#endif if (pnote->descsz < 2 * addr_size) { @@ -19445,7 +19414,7 @@ print_core_note (Elf_Internal_Note *pnote) page_size = byte_get (descdata, addr_size); descdata += addr_size; - if (count > ((bfd_vma) -1 - 2 * addr_size) / (3 * addr_size) + if (count > ((uint64_t) -1 - 2 * addr_size) / (3 * addr_size) || pnote->descsz < 2 * addr_size + count * 3 * addr_size) { error (_(" Malformed note - too short for supplied file count\n")); @@ -19463,7 +19432,7 @@ print_core_note (Elf_Internal_Note *pnote) filenames = descdata + count * 3 * addr_size; while (count-- > 0) { - bfd_vma start, end, file_ofs; + uint64_t start, end, file_ofs; if (filenames == descend) { @@ -20551,7 +20520,7 @@ print_stapsdt_note (Elf_Internal_Note *pnote) unsigned long addr_size = is_32bit_elf ? 4 : 8; char *data = pnote->descdata; char *data_end = pnote->descdata + pnote->descsz; - bfd_vma pc, base_addr, semaphore; + uint64_t pc, base_addr, semaphore; char *provider, *probe, *arg_fmt; if (pnote->descsz < (addr_size * 3)) @@ -20710,7 +20679,6 @@ print_ia64_vms_note (Elf_Internal_Note * pnote) printf (_(" Language: %.*s\n"), maxlen, pnote->descdata); break; -#ifdef BFD64 case NT_VMS_FPMODE: printf (_(" Floating Point mode: ")); if (maxlen < 8) @@ -20718,7 +20686,7 @@ print_ia64_vms_note (Elf_Internal_Note * pnote) /* FIXME: Generate an error if descsz > 8 ? */ printf ("0x%016" PRIx64 "\n", - (uint64_t) byte_get ((unsigned char *) pnote->descdata, 8)); + byte_get ((unsigned char *) pnote->descdata, 8)); break; case NT_VMS_LINKTIME: @@ -20752,12 +20720,11 @@ print_ia64_vms_note (Elf_Internal_Note * pnote) print_vms_time (byte_get ((unsigned char *) pnote->descdata + 8, 8)); printf (_("\n Link flags : ")); printf ("0x%016" PRIx64 "\n", - (uint64_t) byte_get ((unsigned char *) pnote->descdata + 16, 8)); + byte_get ((unsigned char *) pnote->descdata + 16, 8)); printf (_(" Header flags: 0x%08x\n"), (unsigned) byte_get ((unsigned char *) pnote->descdata + 24, 4)); printf (_(" Image id : %.*s\n"), maxlen - 32, pnote->descdata + 32); break; -#endif case NT_VMS_IMGNAM: printf (_(" Image name: %.*s\n"), maxlen, pnote->descdata); @@ -21556,9 +21523,9 @@ process_note (Elf_Internal_Note * pnote, static bool process_notes_at (Filedata * filedata, Elf_Internal_Shdr * section, - bfd_vma offset, - bfd_vma length, - bfd_vma align) + uint64_t offset, + uint64_t length, + uint64_t align) { Elf_External_Note *pnotes; Elf_External_Note *external; @@ -21747,10 +21714,8 @@ process_corefile_note_segments (Filedata * filedata) i++, segment++) { if (segment->p_type == PT_NOTE) - if (! process_notes_at (filedata, NULL, - (bfd_vma) segment->p_offset, - (bfd_vma) segment->p_filesz, - (bfd_vma) segment->p_align)) + if (! process_notes_at (filedata, NULL, segment->p_offset, + segment->p_filesz, segment->p_align)) res = false; } @@ -21758,7 +21723,7 @@ process_corefile_note_segments (Filedata * filedata) } static bool -process_v850_notes (Filedata * filedata, bfd_vma offset, bfd_vma length) +process_v850_notes (Filedata * filedata, uint64_t offset, uint64_t length) { Elf_External_Note * pnotes; Elf_External_Note * external; @@ -21852,10 +21817,8 @@ process_note_sections (Filedata * filedata) { if (section->sh_type == SHT_NOTE) { - if (! process_notes_at (filedata, section, - (bfd_vma) section->sh_offset, - (bfd_vma) section->sh_size, - (bfd_vma) section->sh_addralign)) + if (! process_notes_at (filedata, section, section->sh_offset, + section->sh_size, section->sh_addralign)) res = false; n++; } @@ -21865,9 +21828,8 @@ process_note_sections (Filedata * filedata) || filedata->file_header.e_machine == EM_CYGNUS_V850) && section->sh_type == SHT_RENESAS_INFO) { - if (! process_v850_notes (filedata, - (bfd_vma) section->sh_offset, - (bfd_vma) section->sh_size)) + if (! process_v850_notes (filedata, section->sh_offset, + section->sh_size)) res = false; n++; } @@ -22049,17 +22011,6 @@ get_file_header (Filedata * filedata) { Elf64_External_Ehdr ehdr64; - /* If we have been compiled with sizeof (bfd_vma) == 4, then - we will not be able to cope with the 64bit data found in - 64 ELF files. Detect this now and abort before we start - overwriting things. */ - if (sizeof (bfd_vma) < 8) - { - error (_("This instance of readelf has been built without support for a\n\ -64 bit data type and so it cannot read 64 bit ELF files.\n")); - return false; - } - if (fread (ehdr64.e_type, sizeof (ehdr64) - EI_NIDENT, 1, filedata->handle) != 1) return false;
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=be7d229ad43c7bb1b75693b87790504894220b55 commit be7d229ad43c7bb1b75693b87790504894220b55 Author: Alan Modra <amodra@gmail.com> Date: Fri Aug 12 17:38:08 2022 +0930 Don't use bfd_size_type in readelf.c and dwarf.c Replacing bfd_size_type with dwarf_size_type or uint64_t is mostly cosmetic. The point of the change is to avoid use of a BFD type in readelf, where we'd like to keep as independent of BFD as possible. Also, the patch is a step towards using standard types. Diff: --- binutils/dwarf.c | 58 ++++++++++++------------ binutils/readelf.c | 129 +++++++++++++++++++++++++---------------------------- 2 files changed, 89 insertions(+), 98 deletions(-) diff --git a/binutils/dwarf.c b/binutils/dwarf.c index d862e16388b..fdbe1280ac6 100644 --- a/binutils/dwarf.c +++ b/binutils/dwarf.c @@ -5841,7 +5841,7 @@ display_debug_pubnames_worker (struct dwarf_section *section, while (1) { - bfd_size_type maxprint; + size_t maxprint; dwarf_vma offset; SAFE_BYTE_GET_AND_INC (offset, data, offset_size, start); @@ -8887,12 +8887,12 @@ frame_display_row (Frame_Chunk *fc, int *need_col_headers, unsigned int *max_reg static unsigned char * read_cie (unsigned char *start, unsigned char *end, Frame_Chunk **p_cie, int *p_version, - bfd_size_type *p_aug_len, unsigned char **p_aug) + dwarf_size_type *p_aug_len, unsigned char **p_aug) { int version; Frame_Chunk *fc; unsigned char *augmentation_data = NULL; - bfd_size_type augmentation_data_len = 0; + dwarf_size_type augmentation_data_len = 0; * p_cie = NULL; /* PR 17512: file: 001-228113-0.004. */ @@ -8975,7 +8975,7 @@ read_cie (unsigned char *start, unsigned char *end, READ_ULEB (augmentation_data_len, start, end); augmentation_data = start; /* PR 17512: file: 11042-2589-0.004. */ - if (augmentation_data_len > (bfd_size_type) (end - start)) + if (augmentation_data_len > (size_t) (end - start)) { warn (_("Augmentation data too long: 0x%s, expected at most %#lx\n"), dwarf_vmatoa ("x", augmentation_data_len), @@ -9038,9 +9038,7 @@ read_cie (unsigned char *start, unsigned char *end, output line. */ static void -display_data (bfd_size_type printed, - const unsigned char * data, - const bfd_size_type len) +display_data (size_t printed, const unsigned char *data, size_t len) { if (do_wide || len < ((80 - printed) / 3)) for (printed = 0; printed < len; ++printed) @@ -9060,9 +9058,9 @@ display_data (bfd_size_type printed, If do_wide is not enabled, then formats the output to fit into 80 columns. */ static void -display_augmentation_data (const unsigned char * data, const bfd_size_type len) +display_augmentation_data (const unsigned char * data, dwarf_size_type len) { - bfd_size_type i; + size_t i; i = printf (_(" Augmentation data: ")); display_data (i, data, len); @@ -9095,7 +9093,7 @@ display_debug_frames (struct dwarf_section *section, Frame_Chunk *cie; int need_col_headers = 1; unsigned char *augmentation_data = NULL; - bfd_size_type augmentation_data_len = 0; + dwarf_size_type augmentation_data_len = 0; unsigned int encoded_ptr_size = saved_eh_addr_size; unsigned int offset_size; bool all_nops; @@ -9348,7 +9346,7 @@ display_debug_frames (struct dwarf_section *section, READ_ULEB (augmentation_data_len, start, block_end); augmentation_data = start; /* PR 17512 file: 722-8446-0.004 and PR 22386. */ - if (augmentation_data_len > (bfd_size_type) (block_end - start)) + if (augmentation_data_len > (size_t) (block_end - start)) { warn (_("Augmentation data too long: 0x%s, " "expected at most %#lx\n"), @@ -10498,18 +10496,18 @@ display_debug_links (struct dwarf_section * section, } else /* startswith (section->name, ".gnu_debugaltlink") */ { - const unsigned char * build_id = section->start + filelen + 1; - bfd_size_type build_id_len = section->size - (filelen + 1); - bfd_size_type printed; + const unsigned char *build_id = section->start + filelen + 1; + size_t build_id_len = section->size - (filelen + 1); + size_t printed; /* FIXME: Should we support smaller build-id notes ? */ if (build_id_len < 0x14) { - warn (_("Build-ID is too short (%#lx bytes)\n"), (long) build_id_len); + warn (_("Build-ID is too short (%#zx bytes)\n"), build_id_len); return 0; } - printed = printf (_(" Build-ID (%#lx bytes):"), (long) build_id_len); + printed = printf (_(" Build-ID (%#zx bytes):"), build_id_len); display_data (printed, build_id, build_id_len); putchar ('\n'); } @@ -11236,9 +11234,9 @@ xcalloc2 (size_t nmemb, size_t size) } static unsigned long -calc_gnu_debuglink_crc32 (unsigned long crc, - const unsigned char * buf, - bfd_size_type len) +calc_gnu_debuglink_crc32 (unsigned long crc, + const unsigned char *buf, + size_t len) { static const unsigned long crc32_table[256] = { @@ -11309,11 +11307,11 @@ typedef const char *(* parse_func_type) (struct dwarf_section *, void *); static bool check_gnu_debuglink (const char * pathname, void * crc_pointer) { - static unsigned char buffer [8 * 1024]; - FILE * f; - bfd_size_type count; - unsigned long crc = 0; - void * sep_data; + static unsigned char buffer[8 * 1024]; + FILE *f; + size_t count; + unsigned long crc = 0; + void *sep_data; sep_data = open_debug_file (pathname); if (sep_data == NULL) @@ -11383,17 +11381,17 @@ check_gnu_debugaltlink (const char * filename, void * data ATTRIBUTE_UNUSED) typedef struct build_id_data { - bfd_size_type len; - const unsigned char * data; + size_t len; + const unsigned char *data; } Build_id_data; static const char * parse_gnu_debugaltlink (struct dwarf_section * section, void * data) { - const char * name; - bfd_size_type namelen; - bfd_size_type id_len; - Build_id_data * build_id_data; + const char *name; + size_t namelen; + size_t id_len; + Build_id_data *build_id_data; /* The name is first. The build-id follows immediately, with no padding, up to the section's end. */ diff --git a/binutils/readelf.c b/binutils/readelf.c index af443aa6a97..577a6a155f6 100644 --- a/binutils/readelf.c +++ b/binutils/readelf.c @@ -268,7 +268,7 @@ typedef struct filedata const char * file_name; bool is_separate; FILE * handle; - bfd_size_type file_size; + uint64_t file_size; Elf_Internal_Ehdr file_header; unsigned long archive_file_offset; unsigned long archive_file_size; @@ -278,7 +278,7 @@ typedef struct filedata char * string_table; unsigned long string_table_length; unsigned long dynamic_addr; - bfd_size_type dynamic_size; + uint64_t dynamic_size; size_t dynamic_nent; Elf_Internal_Dyn * dynamic_section; Elf_Internal_Shdr * dynamic_strtab_section; @@ -291,12 +291,12 @@ typedef struct filedata unsigned int dynamic_syminfo_nent; Elf_Internal_Syminfo * dynamic_syminfo; unsigned long dynamic_syminfo_offset; - bfd_size_type nbuckets; - bfd_size_type nchains; + uint64_t nbuckets; + uint64_t nchains; bfd_vma * buckets; bfd_vma * chains; - bfd_size_type ngnubuckets; - bfd_size_type ngnuchains; + uint64_t ngnubuckets; + uint64_t ngnuchains; bfd_vma * gnubuckets; bfd_vma * gnuchains; bfd_vma * mipsxlat; @@ -439,40 +439,32 @@ get_dynamic_name (const Filedata *filedata, size_t offset) message using REASON as part of the context. */ static void * -get_data (void * var, - Filedata * filedata, - unsigned long offset, - bfd_size_type size, - bfd_size_type nmemb, - const char * reason) +get_data (void *var, + Filedata *filedata, + unsigned long offset, + uint64_t size, + uint64_t nmemb, + const char *reason) { void * mvar; - bfd_size_type amt = size * nmemb; + uint64_t amt = size * nmemb; if (size == 0 || nmemb == 0) return NULL; - /* If the size_t type is smaller than the bfd_size_type, eg because - you are building a 32-bit tool on a 64-bit host, then make sure - that when the sizes are cast to (size_t) no information is lost. */ + /* If size_t is smaller than uint64_t, eg because you are building + on a 32-bit host, then make sure that when the sizes are cast to + size_t no information is lost. */ if ((size_t) size != size || (size_t) nmemb != nmemb - || (size_t) amt != amt) - { - if (reason) - error (_("Size truncation prevents reading %" PRIu64 - " elements of size %" PRIu64 " for %s\n"), - (uint64_t) nmemb, (uint64_t) size, reason); - return NULL; - } - - /* Check for size overflow. */ - if (amt / size != nmemb || (size_t) amt + 1 == 0) + || (size_t) amt != amt + || amt / size != nmemb + || (size_t) amt + 1 == 0) { if (reason) error (_("Size overflow prevents reading %" PRIu64 " elements of size %" PRIu64 " for %s\n"), - (uint64_t) nmemb, (uint64_t) size, reason); + nmemb, size, reason); return NULL; } @@ -484,7 +476,7 @@ get_data (void * var, { if (reason) error (_("Reading %" PRIu64 " bytes extends past end of file for %s\n"), - (uint64_t) amt, reason); + amt, reason); return NULL; } @@ -507,7 +499,7 @@ get_data (void * var, { if (reason) error (_("Out of memory allocating %" PRIu64 " bytes for %s\n"), - (uint64_t) amt, reason); + amt, reason); return NULL; } @@ -518,7 +510,7 @@ get_data (void * var, { if (reason) error (_("Unable to read in %" PRIu64 " bytes of %s\n"), - (uint64_t) amt, reason); + amt, reason); if (mvar != var) free (mvar); return NULL; @@ -2615,7 +2607,7 @@ static void locate_dynamic_section (Filedata *filedata) { unsigned long dynamic_addr = 0; - bfd_size_type dynamic_size = 0; + uint64_t dynamic_size = 0; if (filedata->file_header.e_phnum != 0 && get_program_headers (filedata)) @@ -6045,7 +6037,7 @@ process_program_headers (Filedata * filedata) } unsigned long dynamic_addr = 0; - bfd_size_type dynamic_size = 0; + uint64_t dynamic_size = 0; for (i = 0, segment = filedata->program_headers; i < filedata->file_header.e_phnum; i++, segment++) @@ -6293,7 +6285,7 @@ the .dynamic section is not the same as the dynamic segment\n")); /* Find the file offset corresponding to VMA by using the program headers. */ static long -offset_from_vma (Filedata * filedata, bfd_vma vma, bfd_size_type size) +offset_from_vma (Filedata * filedata, bfd_vma vma, uint64_t size) { Elf_Internal_Phdr * seg; @@ -7028,7 +7020,8 @@ get_elf_section_flags (Filedata * filedata, bfd_vma sh_flags) } static unsigned int ATTRIBUTE_WARN_UNUSED_RESULT -get_compression_header (Elf_Internal_Chdr *chdr, unsigned char *buf, bfd_size_type size) +get_compression_header (Elf_Internal_Chdr *chdr, unsigned char *buf, + uint64_t size) { if (is_32bit_elf) { @@ -7169,13 +7162,13 @@ process_section_headers (Filedata * filedata) #define CHECK_ENTSIZE_VALUES(section, i, size32, size64) \ do \ { \ - bfd_size_type expected_entsize = is_32bit_elf ? size32 : size64; \ + uint64_t expected_entsize = is_32bit_elf ? size32 : size64; \ if (section->sh_entsize != expected_entsize) \ { \ error (_("Section %d has invalid sh_entsize of %" PRIx64 "\n"), \ i, (uint64_t) section->sh_entsize); \ error (_("(Using the expected size of %" PRIx64 " for the rest of this dump)\n"), \ - (uint64_t) expected_entsize); \ + expected_entsize); \ section->sh_entsize = expected_entsize; \ } \ } \ @@ -10920,20 +10913,20 @@ print_dynamic_flags (bfd_vma flags) } static bfd_vma * -get_dynamic_data (Filedata * filedata, bfd_size_type number, unsigned int ent_size) +get_dynamic_data (Filedata * filedata, uint64_t number, unsigned int ent_size) { unsigned char * e_data; bfd_vma * i_data; - /* If the size_t type is smaller than the bfd_size_type, eg because - you are building a 32-bit tool on a 64-bit host, then make sure - that when (number) is cast to (size_t) no information is lost. */ - if (sizeof (size_t) < sizeof (bfd_size_type) - && (bfd_size_type) ((size_t) number) != number) + /* If size_t is smaller than uint64_t, eg because you are building + on a 32-bit host, then make sure that when number is cast to + size_t no information is lost. */ + if ((size_t) number != number + || ent_size * number / ent_size != number) { - error (_("Size truncation prevents reading %" PRIu64 + error (_("Size overflow prevents reading %" PRIu64 " elements of size %u\n"), - (uint64_t) number, ent_size); + number, ent_size); return NULL; } @@ -10942,7 +10935,7 @@ get_dynamic_data (Filedata * filedata, bfd_size_type number, unsigned int ent_si if (ent_size * number > filedata->file_size) { error (_("Invalid number of dynamic entries: %" PRIu64 "\n"), - (uint64_t) number); + number); return NULL; } @@ -10950,14 +10943,14 @@ get_dynamic_data (Filedata * filedata, bfd_size_type number, unsigned int ent_si if (e_data == NULL) { error (_("Out of memory reading %" PRIu64 " dynamic entries\n"), - (uint64_t) number); + number); return NULL; } if (fread (e_data, ent_size, (size_t) number, filedata->handle) != number) { error (_("Unable to read in %" PRIu64 " bytes of dynamic data\n"), - (uint64_t) number * ent_size); + number * ent_size); free (e_data); return NULL; } @@ -10966,7 +10959,7 @@ get_dynamic_data (Filedata * filedata, bfd_size_type number, unsigned int ent_si if (i_data == NULL) { error (_("Out of memory allocating space for %" PRIu64 " dynamic entries\n"), - (uint64_t) number); + number); free (e_data); return NULL; } @@ -11348,7 +11341,7 @@ the .dynsym section doesn't match the DT_SYMTAB and DT_SYMENT tags\n")); && filedata->dynamic_info[DT_STRSZ]) { unsigned long offset; - bfd_size_type str_tab_len = filedata->dynamic_info[DT_STRSZ]; + uint64_t str_tab_len = filedata->dynamic_info[DT_STRSZ]; offset = offset_from_vma (filedata, filedata->dynamic_info[DT_STRTAB], @@ -14872,12 +14865,12 @@ reloc_at (struct dwarf_section * dsec, dwarf_vma offset) more relocations ? */ static bool -apply_relocations (Filedata * filedata, - const Elf_Internal_Shdr * section, - unsigned char * start, - bfd_size_type size, - void ** relocs_return, - unsigned long * num_relocs_return) +apply_relocations (Filedata *filedata, + const Elf_Internal_Shdr *section, + unsigned char *start, + size_t size, + void **relocs_return, + unsigned long *num_relocs_return) { Elf_Internal_Shdr * relsec; unsigned char * end = start + size; @@ -15139,7 +15132,7 @@ disassemble_section (Elf_Internal_Shdr * section, Filedata * filedata) static char * get_section_contents (Elf_Internal_Shdr * section, Filedata * filedata) { - bfd_size_type num_bytes = section->sh_size; + uint64_t num_bytes = section->sh_size; if (num_bytes == 0 || section->sh_type == SHT_NOBITS) { @@ -15210,7 +15203,7 @@ static bool dump_section_as_strings (Elf_Internal_Shdr * section, Filedata * filedata) { Elf_Internal_Shdr *relsec; - bfd_size_type num_bytes; + uint64_t num_bytes; unsigned char *data; unsigned char *end; unsigned char *real_start; @@ -15425,13 +15418,13 @@ dump_section_as_bytes (Elf_Internal_Shdr *section, Filedata *filedata, bool relocate) { - Elf_Internal_Shdr * relsec; - bfd_size_type bytes; - bfd_size_type section_size; - bfd_vma addr; - unsigned char * data; - unsigned char * real_start; - unsigned char * start; + Elf_Internal_Shdr *relsec; + size_t bytes; + uint64_t section_size; + bfd_vma addr; + unsigned char *data; + unsigned char *real_start; + unsigned char *start; real_start = start = (unsigned char *) get_section_contents (section, filedata); if (start == NULL) @@ -16139,7 +16132,7 @@ display_debug_section (int shndx, Elf_Internal_Shdr * section, Filedata * fileda const char *name = (section_name_valid (filedata, section) ? section_name (filedata, section) : ""); const char *print_name = printable_section_name (filedata, section); - bfd_size_type length; + uint64_t length; bool result = true; int i; @@ -22167,7 +22160,7 @@ open_file (const char * pathname, bool is_separate) if (filedata->handle == NULL) goto fail; - filedata->file_size = (bfd_size_type) statbuf.st_size; + filedata->file_size = statbuf.st_size; filedata->file_name = pathname; filedata->is_separate = is_separate; @@ -22727,7 +22720,7 @@ process_file (char * file_name) return false; } - filedata->file_size = (bfd_size_type) statbuf.st_size; + filedata->file_size = statbuf.st_size; filedata->is_separate = false; if (memcmp (armag, ARMAG, SARMAG) == 0)
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=928c411de46e876edd545c3bc0d8bd6a663d0c8f commit 928c411de46e876edd545c3bc0d8bd6a663d0c8f Author: Alan Modra <amodra@gmail.com> Date: Fri Aug 12 17:14:37 2022 +0930 Replace elf_vma with uint64_t This patch replaces all uses of elf_vma with uint64_t, removes tests of sizeof (elf_vma), and does a little tidying of byte_get_little_endian and byte_get_big_endian. Diff: --- binutils/elfcomm.c | 179 ++++++++++++++++++++++++----------------------------- binutils/elfcomm.h | 20 +++--- binutils/readelf.c | 4 +- 3 files changed, 93 insertions(+), 110 deletions(-) diff --git a/binutils/elfcomm.c b/binutils/elfcomm.c index b772176496b..0e7d0b57ac6 100644 --- a/binutils/elfcomm.c +++ b/binutils/elfcomm.c @@ -63,12 +63,12 @@ warn (const char *message, ...) va_end (args); } -void (*byte_put) (unsigned char *, elf_vma, unsigned int); +void (*byte_put) (unsigned char *, uint64_t, unsigned int); void -byte_put_little_endian (unsigned char * field, elf_vma value, unsigned int size) +byte_put_little_endian (unsigned char *field, uint64_t value, unsigned int size) { - if (size > sizeof (elf_vma)) + if (size > sizeof (uint64_t)) { error (_("Unhandled data length: %d\n"), size); abort (); @@ -81,9 +81,9 @@ byte_put_little_endian (unsigned char * field, elf_vma value, unsigned int size) } void -byte_put_big_endian (unsigned char * field, elf_vma value, unsigned int size) +byte_put_big_endian (unsigned char *field, uint64_t value, unsigned int size) { - if (size > sizeof (elf_vma)) + if (size > sizeof (uint64_t)) { error (_("Unhandled data length: %d\n"), size); abort (); @@ -95,9 +95,9 @@ byte_put_big_endian (unsigned char * field, elf_vma value, unsigned int size) } } -elf_vma (*byte_get) (const unsigned char *, unsigned int); +uint64_t (*byte_get) (const unsigned char *, unsigned int); -elf_vma +uint64_t byte_get_little_endian (const unsigned char *field, unsigned int size) { switch (size) @@ -106,61 +106,53 @@ byte_get_little_endian (const unsigned char *field, unsigned int size) return *field; case 2: - return ((unsigned int) (field[0])) - | (((unsigned int) (field[1])) << 8); + return ((uint64_t) field[0] + | ((uint64_t) field[1] << 8)); case 3: - return ((unsigned long) (field[0])) - | (((unsigned long) (field[1])) << 8) - | (((unsigned long) (field[2])) << 16); + return ((uint64_t) field[0] + | ((uint64_t) field[1] << 8) + | ((uint64_t) field[2] << 16)); case 4: - return ((unsigned long) (field[0])) - | (((unsigned long) (field[1])) << 8) - | (((unsigned long) (field[2])) << 16) - | (((unsigned long) (field[3])) << 24); + return ((uint64_t) field[0] + | ((uint64_t) field[1] << 8) + | ((uint64_t) field[2] << 16) + | ((uint64_t) field[3] << 24)); case 5: - if (sizeof (elf_vma) >= 8) - return ((elf_vma) (field[0])) - | (((elf_vma) (field[1])) << 8) - | (((elf_vma) (field[2])) << 16) - | (((elf_vma) (field[3])) << 24) - | (((elf_vma) (field[4])) << 32); - /* Fall through. */ + return ((uint64_t) field[0] + | ((uint64_t) field[1] << 8) + | ((uint64_t) field[2] << 16) + | ((uint64_t) field[3] << 24) + | ((uint64_t) field[4] << 32)); case 6: - if (sizeof (elf_vma) >= 8) - return ((elf_vma) (field[0])) - | (((elf_vma) (field[1])) << 8) - | (((elf_vma) (field[2])) << 16) - | (((elf_vma) (field[3])) << 24) - | (((elf_vma) (field[4])) << 32) - | (((elf_vma) (field[5])) << 40); - /* Fall through. */ + return ((uint64_t) field[0] + | ((uint64_t) field[1] << 8) + | ((uint64_t) field[2] << 16) + | ((uint64_t) field[3] << 24) + | ((uint64_t) field[4] << 32) + | ((uint64_t) field[5] << 40)); case 7: - if (sizeof (elf_vma) >= 8) - return ((elf_vma) (field[0])) - | (((elf_vma) (field[1])) << 8) - | (((elf_vma) (field[2])) << 16) - | (((elf_vma) (field[3])) << 24) - | (((elf_vma) (field[4])) << 32) - | (((elf_vma) (field[5])) << 40) - | (((elf_vma) (field[6])) << 48); - /* Fall through. */ + return ((uint64_t) field[0] + | ((uint64_t) field[1] << 8) + | ((uint64_t) field[2] << 16) + | ((uint64_t) field[3] << 24) + | ((uint64_t) field[4] << 32) + | ((uint64_t) field[5] << 40) + | ((uint64_t) field[6] << 48)); case 8: - if (sizeof (elf_vma) >= 8) - return ((elf_vma) (field[0])) - | (((elf_vma) (field[1])) << 8) - | (((elf_vma) (field[2])) << 16) - | (((elf_vma) (field[3])) << 24) - | (((elf_vma) (field[4])) << 32) - | (((elf_vma) (field[5])) << 40) - | (((elf_vma) (field[6])) << 48) - | (((elf_vma) (field[7])) << 56); - /* Fall through. */ + return ((uint64_t) field[0] + | ((uint64_t) field[1] << 8) + | ((uint64_t) field[2] << 16) + | ((uint64_t) field[3] << 24) + | ((uint64_t) field[4] << 32) + | ((uint64_t) field[5] << 40) + | ((uint64_t) field[6] << 48) + | ((uint64_t) field[7] << 56)); default: error (_("Unhandled data length: %d\n"), size); @@ -168,7 +160,7 @@ byte_get_little_endian (const unsigned char *field, unsigned int size) } } -elf_vma +uint64_t byte_get_big_endian (const unsigned char *field, unsigned int size) { switch (size) @@ -177,60 +169,53 @@ byte_get_big_endian (const unsigned char *field, unsigned int size) return *field; case 2: - return ((unsigned int) (field[1])) | (((int) (field[0])) << 8); + return ((uint64_t) field[1] + | ((uint64_t) field[0] << 8)); case 3: - return ((unsigned long) (field[2])) - | (((unsigned long) (field[1])) << 8) - | (((unsigned long) (field[0])) << 16); + return ((uint64_t) field[2] + | ((uint64_t) field[1] << 8) + | ((uint64_t) field[0] << 16)); case 4: - return ((unsigned long) (field[3])) - | (((unsigned long) (field[2])) << 8) - | (((unsigned long) (field[1])) << 16) - | (((unsigned long) (field[0])) << 24); + return ((uint64_t) field[3] + | ((uint64_t) field[2] << 8) + | ((uint64_t) field[1] << 16) + | ((uint64_t) field[0] << 24)); case 5: - if (sizeof (elf_vma) >= 8) - return ((elf_vma) (field[4])) - | (((elf_vma) (field[3])) << 8) - | (((elf_vma) (field[2])) << 16) - | (((elf_vma) (field[1])) << 24) - | (((elf_vma) (field[0])) << 32); - /* Fall through. */ + return ((uint64_t) field[4] + | ((uint64_t) field[3] << 8) + | ((uint64_t) field[2] << 16) + | ((uint64_t) field[1] << 24) + | ((uint64_t) field[0] << 32)); case 6: - if (sizeof (elf_vma) >= 8) - return ((elf_vma) (field[5])) - | (((elf_vma) (field[4])) << 8) - | (((elf_vma) (field[3])) << 16) - | (((elf_vma) (field[2])) << 24) - | (((elf_vma) (field[1])) << 32) - | (((elf_vma) (field[0])) << 40); - /* Fall through. */ + return ((uint64_t) field[5] + | ((uint64_t) field[4] << 8) + | ((uint64_t) field[3] << 16) + | ((uint64_t) field[2] << 24) + | ((uint64_t) field[1] << 32) + | ((uint64_t) field[0] << 40)); case 7: - if (sizeof (elf_vma) >= 8) - return ((elf_vma) (field[6])) - | (((elf_vma) (field[5])) << 8) - | (((elf_vma) (field[4])) << 16) - | (((elf_vma) (field[3])) << 24) - | (((elf_vma) (field[2])) << 32) - | (((elf_vma) (field[1])) << 40) - | (((elf_vma) (field[0])) << 48); - /* Fall through. */ + return ((uint64_t) field[6] + | ((uint64_t) field[5] << 8) + | ((uint64_t) field[4] << 16) + | ((uint64_t) field[3] << 24) + | ((uint64_t) field[2] << 32) + | ((uint64_t) field[1] << 40) + | ((uint64_t) field[0] << 48)); case 8: - if (sizeof (elf_vma) >= 8) - return ((elf_vma) (field[7])) - | (((elf_vma) (field[6])) << 8) - | (((elf_vma) (field[5])) << 16) - | (((elf_vma) (field[4])) << 24) - | (((elf_vma) (field[3])) << 32) - | (((elf_vma) (field[2])) << 40) - | (((elf_vma) (field[1])) << 48) - | (((elf_vma) (field[0])) << 56); - /* Fall through. */ + return ((uint64_t) field[7] + | ((uint64_t) field[6] << 8) + | ((uint64_t) field[5] << 16) + | ((uint64_t) field[4] << 24) + | ((uint64_t) field[3] << 32) + | ((uint64_t) field[2] << 40) + | ((uint64_t) field[1] << 48) + | ((uint64_t) field[0] << 56)); default: error (_("Unhandled data length: %d\n"), size); @@ -238,10 +223,10 @@ byte_get_big_endian (const unsigned char *field, unsigned int size) } } -elf_vma +uint64_t byte_get_signed (const unsigned char *field, unsigned int size) { - elf_vma x = byte_get (field, size); + uint64_t x = byte_get (field, size); switch (size) { @@ -430,8 +415,8 @@ process_archive_index_and_symbols (struct archive_info *arch, size -= arch->index_num * sizeof_ar_index; /* Convert the index numbers into the host's numeric format. */ - arch->index_array = (elf_vma *) - malloc (arch->index_num * sizeof (* arch->index_array)); + arch->index_array = (uint64_t *) + malloc (arch->index_num * sizeof (*arch->index_array)); if (arch->index_array == NULL) { free (index_buffer); diff --git a/binutils/elfcomm.h b/binutils/elfcomm.h index c2ec8d20904..bab46b03451 100644 --- a/binutils/elfcomm.h +++ b/binutils/elfcomm.h @@ -29,16 +29,14 @@ extern void error (const char *, ...) ATTRIBUTE_PRINTF_1; extern void warn (const char *, ...) ATTRIBUTE_PRINTF_1; -typedef unsigned HOST_WIDEST_INT elf_vma; +extern void (*byte_put) (unsigned char *, uint64_t, unsigned int); +extern void byte_put_little_endian (unsigned char *, uint64_t, unsigned int); +extern void byte_put_big_endian (unsigned char *, uint64_t, unsigned int); -extern void (*byte_put) (unsigned char *, elf_vma, unsigned int); -extern void byte_put_little_endian (unsigned char *, elf_vma, unsigned int); -extern void byte_put_big_endian (unsigned char *, elf_vma, unsigned int); - -extern elf_vma (*byte_get) (const unsigned char *, unsigned int); -extern elf_vma byte_get_signed (const unsigned char *, unsigned int); -extern elf_vma byte_get_little_endian (const unsigned char *, unsigned int); -extern elf_vma byte_get_big_endian (const unsigned char *, unsigned int); +extern uint64_t (*byte_get) (const unsigned char *, unsigned int); +extern uint64_t byte_get_signed (const unsigned char *, unsigned int); +extern uint64_t byte_get_little_endian (const unsigned char *, unsigned int); +extern uint64_t byte_get_big_endian (const unsigned char *, unsigned int); #define BYTE_PUT(field, val) byte_put (field, val, sizeof (field)) #define BYTE_GET(field) byte_get (field, sizeof (field)) @@ -53,8 +51,8 @@ struct archive_info { char * file_name; /* Archive file name. */ FILE * file; /* Open file descriptor. */ - elf_vma index_num; /* Number of symbols in table. */ - elf_vma * index_array; /* The array of member offsets. */ + uint64_t index_num; /* Number of symbols in table. */ + uint64_t * index_array; /* The array of member offsets. */ char * sym_table; /* The symbol table. */ unsigned long sym_size; /* Size of the symbol table. */ char * longnames; /* The long file names table. */ diff --git a/binutils/readelf.c b/binutils/readelf.c index ed764591765..af443aa6a97 100644 --- a/binutils/readelf.c +++ b/binutils/readelf.c @@ -13395,10 +13395,10 @@ display_lto_symtab (Filedata * filedata, unsigned int kind = *data++; unsigned int visibility = *data++; - elf_vma size = byte_get (data, 8); + uint64_t size = byte_get (data, 8); data += 8; - elf_vma slot = byte_get (data, 4); + uint64_t slot = byte_get (data, 4); data += 4; if (ext_data != NULL)
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=ccaa2449e26381654ef67a6093c762dd250ff041 commit ccaa2449e26381654ef67a6093c762dd250ff041 Author: GDB Administrator <gdbadmin@sourceware.org> Date: Sat Aug 13 00:00:32 2022 +0000 Automatic date update in version.in Diff: --- bfd/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bfd/version.h b/bfd/version.h index 34016adb0d1..85ff36d5743 100644 --- a/bfd/version.h +++ b/bfd/version.h @@ -16,7 +16,7 @@ In releases, the date is not included in either version strings or sonames. */ -#define BFD_VERSION_DATE 20220812 +#define BFD_VERSION_DATE 20220813 #define BFD_VERSION @bfd_version@ #define BFD_VERSION_STRING @bfd_version_package@ @bfd_version_string@ #define REPORT_BUGS_TO @report_bugs_to@
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=a9d4faaab1e13974d02b7ba740665279e4f0bdf6 commit a9d4faaab1e13974d02b7ba740665279e4f0bdf6 Author: GDB Administrator <gdbadmin@sourceware.org> Date: Sat Aug 13 00:00:19 2022 +0000 Automatic date update in version.in Diff: --- bfd/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bfd/version.h b/bfd/version.h index 34016adb0d1..85ff36d5743 100644 --- a/bfd/version.h +++ b/bfd/version.h @@ -16,7 +16,7 @@ In releases, the date is not included in either version strings or sonames. */ -#define BFD_VERSION_DATE 20220812 +#define BFD_VERSION_DATE 20220813 #define BFD_VERSION @bfd_version@ #define BFD_VERSION_STRING @bfd_version_package@ @bfd_version_string@ #define REPORT_BUGS_TO @report_bugs_to@
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=901dd67d0d68ac5e0be145d137533f03de495272 commit 901dd67d0d68ac5e0be145d137533f03de495272 Author: GDB Administrator <gdbadmin@sourceware.org> Date: Sat Aug 13 00:00:06 2022 +0000 Automatic date update in version.in Diff: --- bfd/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bfd/version.h b/bfd/version.h index 34016adb0d1..85ff36d5743 100644 --- a/bfd/version.h +++ b/bfd/version.h @@ -16,7 +16,7 @@ In releases, the date is not included in either version strings or sonames. */ -#define BFD_VERSION_DATE 20220812 +#define BFD_VERSION_DATE 20220813 #define BFD_VERSION @bfd_version@ #define BFD_VERSION_STRING @bfd_version_package@ @bfd_version_string@ #define REPORT_BUGS_TO @report_bugs_to@
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=74dfcd530873f68d57a3613062242d02dddb1d4e commit 74dfcd530873f68d57a3613062242d02dddb1d4e Author: GDB Administrator <gdbadmin@sourceware.org> Date: Fri Aug 12 00:00:53 2022 +0000 Automatic date update in version.in Diff: --- bfd/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bfd/version.h b/bfd/version.h index 395ff1902aa..34016adb0d1 100644 --- a/bfd/version.h +++ b/bfd/version.h @@ -16,7 +16,7 @@ In releases, the date is not included in either version strings or sonames. */ -#define BFD_VERSION_DATE 20220811 +#define BFD_VERSION_DATE 20220812 #define BFD_VERSION @bfd_version@ #define BFD_VERSION_STRING @bfd_version_package@ @bfd_version_string@ #define REPORT_BUGS_TO @report_bugs_to@