This is the mail archive of the mailing list for the GDB project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] Fix GCC9 warning on elf32-arm.c:elf32_arm_final_link_relocate

*** TEST RESULTS FOR COMMIT 453f8e1e4918171bc12e4d03aab7ee8360dfcfef ***

Author: Sergio Durigan Junior <>
Branch: master
Commit: 453f8e1e4918171bc12e4d03aab7ee8360dfcfef

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:

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.

2019-01-25  Sergio Durigan Junior  <>

	* elf32-arm.c (elf32_arm_final_link_relocate): Use 'llabs' instead
	of 'labs' (and fix GCC warning).

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]