diff options
author | Jan Beulich <jbeulich@suse.com> | 2021-06-15 07:58:57 +0200 |
---|---|---|
committer | Jan Beulich <jbeulich@suse.com> | 2021-06-15 07:58:57 +0200 |
commit | 86f041462ec31a02efbcecdce8ee52ed2f340a68 (patch) | |
tree | acf4d23241bcef4e813336aac49d2a49d1bc9954 | |
parent | 4fe51f7d3ce96953a62c493b8c2615f8577c0f11 (diff) | |
download | fsf-binutils-gdb-86f041462ec31a02efbcecdce8ee52ed2f340a68.zip fsf-binutils-gdb-86f041462ec31a02efbcecdce8ee52ed2f340a68.tar.gz fsf-binutils-gdb-86f041462ec31a02efbcecdce8ee52ed2f340a68.tar.bz2 |
x86: make offset_in_range()'s warning contents useful (again)
In case there is something which gets shortened (perhaps only on a BFD64
build targeting a 32-bit binary), seeing the full original value is
often helpful to understand what's actually going wrong. Of course for
non-64-bit binaries we better wouldn't be seeing such warnings at all,
as they're often indicative of a behavioral difference between BFD64 and
!BFD64 builds.
Prior to "gas: drop sprint_value()", which introduced the use of
bfd_sprintf_vma(), the output had other shortcomings.
-rw-r--r-- | gas/ChangeLog | 5 | ||||
-rw-r--r-- | gas/config/tc-i386.c | 8 |
2 files changed, 7 insertions, 6 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index 8a3684a..97bb57b 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,5 +1,10 @@ 2021-06-15 Jan Beulich <jbeulich@suse.com> + * config/tc-i386.c (offset_in_range): Replace uses of + bfd_sprintf_vma. + +2021-06-15 Jan Beulich <jbeulich@suse.com> + * config/tc-i386.c (offset_in_range): Adjust conditional. * testsuite/gas/i386/disp-imm-16.s, testsuite/gas/i386/disp-imm-16.l, diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c index c9bcccf..da4998c 100644 --- a/gas/config/tc-i386.c +++ b/gas/config/tc-i386.c @@ -2564,13 +2564,9 @@ offset_in_range (offsetT val, int size) } if ((val & ~mask) != 0 && (-val & ~mask) != 0) - { - char buf1[40], buf2[40]; + as_warn (_("%"BFD_VMA_FMT"x shortened to %"BFD_VMA_FMT"x"), + val, val & mask); - bfd_sprintf_vma (stdoutput, buf1, val); - bfd_sprintf_vma (stdoutput, buf2, val & mask); - as_warn (_("%s shortened to %s"), buf1, buf2); - } return val & mask; } |