aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorYufeng Zhang <yufeng.zhang@arm.com>2013-01-08 18:09:12 +0000
committerYufeng Zhang <yufeng.zhang@arm.com>2013-01-08 18:09:12 +0000
commit652451f8f20a6783d60ed921f9d8479f8e91a04e (patch)
treeb55c2592a3ac70b0f32b0254dfa1770d323d1f84 /bfd
parent69276d02644f403e5344c04fc72f867aee3b291a (diff)
downloadgdb-652451f8f20a6783d60ed921f9d8479f8e91a04e.zip
gdb-652451f8f20a6783d60ed921f9d8479f8e91a04e.tar.gz
gdb-652451f8f20a6783d60ed921f9d8479f8e91a04e.tar.bz2
include/elf/
2013-01-08 Yufeng Zhang <yufeng.zhang@arm.com> * common.h (NT_ARM_TLS, NT_ARM_HW_BREAK, NT_ARM_HW_WATCH): New macro definitions. bfd/ 2013-01-08 Yufeng Zhang <yufeng.zhang@arm.com> * elf-bfd.h (elfcore_write_aarch_tls): Add prototype. (elfcore_write_aarch_hw_break): Likewise. (elfcore_write_aarch_hw_watch): Likewise. * elf.c (elfcore_grok_aarch_tls): New function. (elfcore_grok_aarch_hw_break): Likewise. (elfcore_grok_aarch_hw_watch): Likewise. (elfcore_grok_note): Call the new functions to handle the corresponding notes. (elfcore_write_aarch_tls): New function. (elfcore_write_aarch_hw_break): Likewise. (elfcore_write_aarch_hw_watch): Likewise. (elfcore_write_register_note): Call the new functions to handle the corresponding pseudo sections. binutils/ 2013-01-08 Yufeng Zhang <yufeng.zhang@arm.com> * readelf.c (get_note_type): Handle NT_ARM_TLS, NT_ARM_HW_BREAK and NT_ARM_HW_WATCH.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog16
-rw-r--r--bfd/elf-bfd.h8
-rw-r--r--bfd/elf.c84
3 files changed, 106 insertions, 2 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 053dde3..7abc268 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,19 @@
+2013-01-08 Yufeng Zhang <yufeng.zhang@arm.com>
+
+ * elf-bfd.h (elfcore_write_aarch_tls): Add prototype.
+ (elfcore_write_aarch_hw_break): Likewise.
+ (elfcore_write_aarch_hw_watch): Likewise.
+ * elf.c (elfcore_grok_aarch_tls): New function.
+ (elfcore_grok_aarch_hw_break): Likewise.
+ (elfcore_grok_aarch_hw_watch): Likewise.
+ (elfcore_grok_note): Call the new functions to handle the
+ corresponding notes.
+ (elfcore_write_aarch_tls): New function.
+ (elfcore_write_aarch_hw_break): Likewise.
+ (elfcore_write_aarch_hw_watch): Likewise.
+ (elfcore_write_register_note): Call the new functions to handle the
+ corresponding pseudo sections.
+
2013-01-07 Tom Tromey <tromey@redhat.com>
* section.c (_bfd_std_section): Rename from std_section.
diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h
index b8d82b1..533c5d4 100644
--- a/bfd/elf-bfd.h
+++ b/bfd/elf-bfd.h
@@ -1,6 +1,6 @@
/* BFD back-end data structures for ELF files.
Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
- 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
+ 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013
Free Software Foundation, Inc.
Written by Cygnus Support.
@@ -2269,6 +2269,12 @@ extern char *elfcore_write_s390_system_call
(bfd *, char *, int *, const void *, int);
extern char *elfcore_write_arm_vfp
(bfd *, char *, int *, const void *, int);
+extern char *elfcore_write_aarch_tls
+ (bfd *, char *, int *, const void *, int);
+extern char *elfcore_write_aarch_hw_break
+ (bfd *, char *, int *, const void *, int);
+extern char *elfcore_write_aarch_hw_watch
+ (bfd *, char *, int *, const void *, int);
extern char *elfcore_write_lwpstatus
(bfd *, char *, int *, long, int, const void *);
extern char *elfcore_write_register_note
diff --git a/bfd/elf.c b/bfd/elf.c
index 17e9ad4..9cd3542 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -1,7 +1,8 @@
/* ELF executable support for BFD.
Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
- 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
+ 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012,
+ 2013
Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
@@ -8162,6 +8163,24 @@ elfcore_grok_arm_vfp (bfd *abfd, Elf_Internal_Note *note)
return elfcore_make_note_pseudosection (abfd, ".reg-arm-vfp", note);
}
+static bfd_boolean
+elfcore_grok_aarch_tls (bfd *abfd, Elf_Internal_Note *note)
+{
+ return elfcore_make_note_pseudosection (abfd, ".reg-aarch-tls", note);
+}
+
+static bfd_boolean
+elfcore_grok_aarch_hw_break (bfd *abfd, Elf_Internal_Note *note)
+{
+ return elfcore_make_note_pseudosection (abfd, ".reg-aarch-hw-break", note);
+}
+
+static bfd_boolean
+elfcore_grok_aarch_hw_watch (bfd *abfd, Elf_Internal_Note *note)
+{
+ return elfcore_make_note_pseudosection (abfd, ".reg-aarch-hw-watch", note);
+}
+
#if defined (HAVE_PRPSINFO_T)
typedef prpsinfo_t elfcore_psinfo_t;
#if defined (HAVE_PRPSINFO32_T) /* Sparc64 cross Sparc32 */
@@ -8602,6 +8621,27 @@ elfcore_grok_note (bfd *abfd, Elf_Internal_Note *note)
else
return TRUE;
+ case NT_ARM_TLS:
+ if (note->namesz == 6
+ && strcmp (note->namedata, "LINUX") == 0)
+ return elfcore_grok_aarch_tls (abfd, note);
+ else
+ return TRUE;
+
+ case NT_ARM_HW_BREAK:
+ if (note->namesz == 6
+ && strcmp (note->namedata, "LINUX") == 0)
+ return elfcore_grok_aarch_hw_break (abfd, note);
+ else
+ return TRUE;
+
+ case NT_ARM_HW_WATCH:
+ if (note->namesz == 6
+ && strcmp (note->namedata, "LINUX") == 0)
+ return elfcore_grok_aarch_hw_watch (abfd, note);
+ else
+ return TRUE;
+
case NT_PRPSINFO:
case NT_PSINFO:
if (bed->elf_backend_grok_psinfo)
@@ -9406,6 +9446,42 @@ elfcore_write_arm_vfp (bfd *abfd,
}
char *
+elfcore_write_aarch_tls (bfd *abfd,
+ char *buf,
+ int *bufsiz,
+ const void *aarch_tls,
+ int size)
+{
+ char *note_name = "LINUX";
+ return elfcore_write_note (abfd, buf, bufsiz,
+ note_name, NT_ARM_TLS, aarch_tls, size);
+}
+
+char *
+elfcore_write_aarch_hw_break (bfd *abfd,
+ char *buf,
+ int *bufsiz,
+ const void *aarch_hw_break,
+ int size)
+{
+ char *note_name = "LINUX";
+ return elfcore_write_note (abfd, buf, bufsiz,
+ note_name, NT_ARM_HW_BREAK, aarch_hw_break, size);
+}
+
+char *
+elfcore_write_aarch_hw_watch (bfd *abfd,
+ char *buf,
+ int *bufsiz,
+ const void *aarch_hw_watch,
+ int size)
+{
+ char *note_name = "LINUX";
+ return elfcore_write_note (abfd, buf, bufsiz,
+ note_name, NT_ARM_HW_WATCH, aarch_hw_watch, size);
+}
+
+char *
elfcore_write_register_note (bfd *abfd,
char *buf,
int *bufsiz,
@@ -9441,6 +9517,12 @@ elfcore_write_register_note (bfd *abfd,
return elfcore_write_s390_system_call (abfd, buf, bufsiz, data, size);
if (strcmp (section, ".reg-arm-vfp") == 0)
return elfcore_write_arm_vfp (abfd, buf, bufsiz, data, size);
+ if (strcmp (section, ".reg-aarch-tls") == 0)
+ return elfcore_write_aarch_tls (abfd, buf, bufsiz, data, size);
+ if (strcmp (section, ".reg-aarch-hw-break") == 0)
+ return elfcore_write_aarch_hw_break (abfd, buf, bufsiz, data, size);
+ if (strcmp (section, ".reg-aarch-hw-watch") == 0)
+ return elfcore_write_aarch_hw_watch (abfd, buf, bufsiz, data, size);
return NULL;
}