aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorSergio Durigan Junior <sergiodj@redhat.com>2019-01-21 15:36:41 -0500
committerSergio Durigan Junior <sergiodj@redhat.com>2019-01-28 10:50:23 -0500
commit453f8e1e4918171bc12e4d03aab7ee8360dfcfef (patch)
tree9f77e4ffd3740e785a2e47eb5e0c0b3314b861c6 /bfd
parent2d151af7190b9cb7787d4c33fba9e9a4431f8a0c (diff)
downloadgdb-453f8e1e4918171bc12e4d03aab7ee8360dfcfef.zip
gdb-453f8e1e4918171bc12e4d03aab7ee8360dfcfef.tar.gz
gdb-453f8e1e4918171bc12e4d03aab7ee8360dfcfef.tar.bz2
Fix GCC9 warning on elf32-arm.c:elf32_arm_final_link_relocate
Fedora Rawhide has just switched to GCC9, and now GDB doesn't compile because of a BFD warning: BUILDSTDERR: ../../bfd/elf32-arm.c: In function 'elf32_arm_final_link_relocate': BUILDSTDERR: ../../bfd/elf32-arm.c:10907:10: error: absolute value function 'labs' given an argument of type 'bfd_signed_vma' {aka 'long long int'} but has parameter of type 'long int' which may cause truncation of value [-Werror=absolute-value] BUILDSTDERR: 10907 | value = labs (relocation); BUILDSTDERR: | ^~~~ You can take a look at the full build log here: https://kojipkgs.fedoraproject.org//work/tasks/4828/32174828/build.log The fix is (apparently) simple: instead of using 'labs', we should use 'llabs', since we're passing a 'bfd_signed_vma' to it, which is at least a 'long long int', as far as I have checked. This is what this patch does. bfd/ChangeLog: 2019-01-25 Sergio Durigan Junior <sergiodj@redhat.com> * elf32-arm.c (elf32_arm_final_link_relocate): Use 'llabs' instead of 'labs' (and fix GCC warning).
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog5
-rw-r--r--bfd/elf32-arm.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 69fa844..5547cd2 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,8 @@
+2019-01-21 Sergio Durigan Junior <sergiodj@redhat.com>
+
+ * elf32-arm.c (elf32_arm_final_link_relocate): Use 'llabs' instead
+ of 'labs' (and fix GCC warning).
+
2019-01-25 Nick Clifton <nickc@redhat.com>
* po/ru.po: Updated Russian translation.
diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c
index 53baea2..28ee9d5 100644
--- a/bfd/elf32-arm.c
+++ b/bfd/elf32-arm.c
@@ -10904,7 +10904,7 @@ elf32_arm_final_link_relocate (reloc_howto_type * howto,
/* PR 21523: Use an absolute value. The user of this reloc will
have already selected an ADD or SUB insn appropriately. */
- value = labs (relocation);
+ value = llabs (relocation);
if (value >= 0x1000)
return bfd_reloc_overflow;