Sourceware Bugzilla – Attachment 15234 Details for
Bug 31096
nm for mips32 (native or cross-compiled) shows 32bit addresses as sign-extended 64bit addresses
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
nm: Enforce 32-bit width limit when printing 32-bit values
0001-nm-Enforce-32-bit-width-printing-of-values.patch (text/plain), 1.39 KB, created by
Nicolas Schier
on 2023-12-04 13:07:17 UTC
(
hide
)
Description:
nm: Enforce 32-bit width limit when printing 32-bit values
Filename:
MIME Type:
Creator:
Nicolas Schier
Created:
2023-12-04 13:07:17 UTC
Size:
1.39 KB
patch
obsolete
>From b06fb2b38b4bb88b3de1aca390489c4f31ee03ff Mon Sep 17 00:00:00 2001 >From: Nicolas Schier <n.schier@avm.de> >Date: Mon, 4 Dec 2023 10:28:06 +0100 >Subject: [PATCH] nm: Enforce 32-bit width limit when printing 32-bit values >Organization: AVM GmbH >To: binutils@sourceware.org >Cc: Johannes Nixdorf <j.nixdorf@avm.de> > >Enforce printing only lower-half of 64-bit values if 32-bit print width >is requested. > >Printing 32-bit values >= 0x80000000 on MIPS32 causes effective output >of a sign-extended 64-bit value since commit 0e3c1eebb22 ("Remove use of >bfd_uint64_t and similar", 2022-05-27). While this might be considered >appropriate for a "signed address-space", the output differs from other >tools from binutils, e.g. objdump, which always prints 32-bit values as >32-bit values. > >Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31096 >Fixes: 0e3c1eebb22e ("Remove use of bfd_uint64_t and similar") >Signed-off-by: Nicolas Schier <n.schier@avm.de> >--- > binutils/nm.c | 3 +++ > 1 file changed, 3 insertions(+) > >diff --git a/binutils/nm.c b/binutils/nm.c >index e4c8036df1b..7e42ce8f469 100644 >--- a/binutils/nm.c >+++ b/binutils/nm.c >@@ -1821,6 +1821,9 @@ print_value (bfd *abfd ATTRIBUTE_UNUSED, bfd_vma val) > switch (print_width) > { > case 32: >+ printf (print_format_string, 0xffffffff & (uint64_t) val); >+ break; >+ > case 64: > printf (print_format_string, (uint64_t) val); > break; >-- >2.40.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 31096
: 15234