This is the mail archive of the binutils@sourceware.org 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]

[PATCH] Fix build error on OpenBSD/sparc


Apparently GCC 2.95.3 doesn't like #ifdef inside a macro arg:

../../../src/gdb/bfd/elf.c:6381: warning: preprocessing directive not recognized within macro arg

Here's a diff that works around the problem.

ok?


Index: ChangeLog
from  Mark Kettenis  <kettenis@gnu.org>

	* elf.c (swap_out_syms): Avoid preprocessing directive within
	macro arg.

Index: elf.c
===================================================================
RCS file: /cvs/src/src/bfd/elf.c,v
retrieving revision 1.433
diff -u -p -r1.433 elf.c
--- elf.c 15 Feb 2008 08:27:18 -0000 1.433
+++ elf.c 17 Feb 2008 11:54:53 -0000
@@ -6374,11 +6374,15 @@ Unable to find equivalent output section
 	    sym.st_info = ELF_ST_INFO (STB_LOCAL, STT_SECTION);
 	}
       else if (bfd_is_com_section (syms[idx]->section))
-	sym.st_info = ELF_ST_INFO (STB_GLOBAL,
+	{
 #ifdef USE_STT_COMMON
-				   type == STT_OBJECT ? STT_COMMON :
+	  if (type == STT_OBJECT)
+	    sym.st_info = ELF_ST_INFO (STB_GLOBAL, STT_COMMON);
+	  else
+#else
+	    sym.st_info = ELF_ST_INFO (STB_GLOBAL, type);
 #endif
-				   type);
+	}
       else if (bfd_is_und_section (syms[idx]->section))
 	sym.st_info = ELF_ST_INFO (((flags & BSF_WEAK)
 				    ? STB_WEAK


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