This is the mail archive of the mailing list for the binutils 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]

Re: Commit: Replace BFD set macros with static inline functions

On Wed, 29 Jan 2014, Nick Clifton wrote:

> Hi Guys,
>   Following up on Tom's suggestion I am checking in the patch below to
>   replace the various bfd_xxx_set macros with static inline functions,
>   so that we can avoid compile time warnings about comma expressions
>   with unused values.

...and trivial errors from some unused operands.

> bfd/ChangeLog
> 2014-01-29  Nick Clifton  <>
> 	* bfd-in.h (bfd_set_section_vma): Delete.
> 	(bfd_set_section_alignment): Delete.
> 	(bfd_set_section_userdata): Delete.
> 	(bfd_set_cacheable): Delete.
> 	* bfd.c (bfd_set_cacheable): New static inline function.
> 	* section.c (bfd_set_section_userdata): Likewise.
> 	(bfd_set_section_vma): Likewise.
> 	(bfd_set_section_alignment): Likewise.
> 	* bfd-in2.h: Regenerate.

Hi Nick.  This broke mmix-knuth-mmixware due to a typo in one of
its linker files (gasp!)  Still, perhaps there should be an
accessor for sec->owner?

diff --git a/ld/ChangeLog b/ld/ChangeLog
index e765743..1c95e25 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,9 @@
+2014-02-01  Hans-Peter Nilsson  <>
+	* emultempl/mmix-elfnmmo.em (mmix_after_allocation): Fix typo in
+	call to bfd_set_section_vma exposed by recent bfd_set_section_vma
+	change.
 2014-01-30  Sandra Loosemore  <>

 	* (enios2elf.c, enios2linux.c): Update dependencies.
diff --git a/ld/emultempl/mmix-elfnmmo.em b/ld/emultempl/mmix-elfnmmo.em
index 0059792..5e9781a 100644
--- a/ld/emultempl/mmix-elfnmmo.em
+++ b/ld/emultempl/mmix-elfnmmo.em
@@ -102,7 +102,7 @@ mmix_after_allocation (void)
      This section is only present when there are register symbols.  */
   sec = bfd_get_section_by_name (link_info.output_bfd, MMIX_REG_SECTION_NAME);
   if (sec != NULL)
-    bfd_set_section_vma (abfd, sec, 0);
+    bfd_set_section_vma (sec->owner, sec, 0);

   if (!_bfd_mmix_after_linker_allocation (link_info.output_bfd, &link_info))

Tested, committed.

brgds, H-P

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