bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

64 bit ABI not set correctly for IA64 elf binaries when using objcopy


From: Volkmar Uhlig
Subject: 64 bit ABI not set correctly for IA64 elf binaries when using objcopy
Date: Tue, 23 Jul 2002 05:52:04 -0400

When using objcopy for IA64 using binary as input format, objcopy does 
not set the 64 bit ABI flag in the elf header. Thus, the generated elf file 
is for the wrong ABI and the linker denies linking. 

To reproduce the problem do:
objcopy -B ia64 -I binary -O default <somefile> <outputfile>
objdump -x <outputfile>

You will see, that the private flags of the output file have ABI32 not 
ABI64 set.

The following patch solves the problem for the current CVS head 
revision of binutils.

- Volkmar

Index: bfd/elfxx-ia64.c
==============================================
=====================
RCS file: /cvs/src/src/bfd/elfxx-ia64.c,v
retrieving revision 1.53
diff -u -r1.53 elfxx-ia64.c
--- bfd/elfxx-ia64.c 19 Jul 2002 01:10:28 -0000 1.53
+++ bfd/elfxx-ia64.c 23 Jul 2002 09:34:38 -0000
@@ -179,6 +179,8 @@
 PARAMS ((flagword *, ElfNN_Internal_Shdr *));
 static boolean elfNN_ia64_fake_sections
 PARAMS ((bfd *abfd, ElfNN_Internal_Shdr *hdr, asection *sec));
+static boolean elfNN_ia64_elf_object_p 
+ PARAMS ((bfd * abfd));
 static void elfNN_ia64_final_write_processing
 PARAMS ((bfd *abfd, boolean linker));
 static boolean elfNN_ia64_add_symbol_hook
@@ -1046,6 +1048,17 @@
 return true;
 }
 
+static boolean
+elfNN_ia64_elf_object_p (abfd)
+ bfd *abfd;
+{ 
+ /* if the machine is a 64 bit target set the ABI64 bit in the e_flags */
+ if (bfd_get_mach(abfd) == bfd_mach_ia64_elf64)
+ elf_elfheader(abfd)->e_flags |= EF_IA_64_ABI64;
+ return true;
+}
+
+
 /* Convert IA-64 specific section flags to bfd internal section flags. */
 
 /* ??? There is no bfd internal flag equivalent to the 
SHF_IA_64_NORECOV
@@ -4688,6 +4701,8 @@
 elfNN_ia64_section_flags
 #define elf_backend_fake_sections \
 elfNN_ia64_fake_sections
+#define elf_backend_object_p \
+ elfNN_ia64_elf_object_p
 #define elf_backend_final_write_processing \
 elfNN_ia64_final_write_processing
 #define elf_backend_add_symbol_hook \


______________________________________________________
Multimedia Messaging ist da! Die Zukunft des Messaging hat begonnen. 
http://mobile.lycos.de/mobile/local/mms/


reply via email to

[Prev in Thread] Current Thread [Next in Thread]