summaryrefslogtreecommitdiff
path: root/bfd/coffcode.h
diff options
context:
space:
mode:
Diffstat (limited to 'bfd/coffcode.h')
-rw-r--r--bfd/coffcode.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/bfd/coffcode.h b/bfd/coffcode.h
index ee50a10993c..da8121fd77f 100644
--- a/bfd/coffcode.h
+++ b/bfd/coffcode.h
@@ -1899,6 +1899,27 @@ coff_set_arch_mach_hook (abfd, filehdr)
currently the XScale. */
case F_ARM_5: machine = bfd_mach_arm_XScale; break;
}
+
+ {
+ asection * arm_arch_section;
+
+ arm_arch_section = bfd_get_section_by_name (abfd, ".note");
+
+ if (arm_arch_section)
+ {
+ bfd_byte buffer [4];
+
+ if (! bfd_get_section_contents (abfd, arm_arch_section, buffer,
+ (file_ptr) 0, sizeof buffer))
+ (*_bfd_error_handler)
+ (_("%s: warning: unable to retrieve .note section from %s"),
+ bfd_get_filename (abfd));
+
+ /* We have to extract the value this way to allow for a
+ host whose endian-ness is different from the target. */
+ machine = bfd_get_32 (abfd, buffer);
+ }
+ }
break;
#endif
#ifdef MC68MAGIC