[PATCH] BFD: Consider any section whose name starts with ".__abs" to be absolute.

John Darrington john@darrington.wattle.id.au
Sat Jun 23 16:35:00 GMT 2018


* bfd/section.c (bfd_is_abs_section): Consider the name of the section.
* bfd/bfd-in2.h: regen
---
 bfd/bfd-in2.h | 4 +++-
 bfd/section.c | 4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h
index f53dbb5e8c..7f7718e0e1 100644
--- a/bfd/bfd-in2.h
+++ b/bfd/bfd-in2.h
@@ -1717,7 +1717,9 @@ extern asection _bfd_std_section[4];
 #define bfd_ind_section_ptr (&_bfd_std_section[3])
 
 #define bfd_is_und_section(sec) ((sec) == bfd_und_section_ptr)
-#define bfd_is_abs_section(sec) ((sec) == bfd_abs_section_ptr)
+#define bfd_is_abs_section(sec)                \
+  (((sec) == bfd_abs_section_ptr) ||           \
+  (0 == strncmp (".__abs", sec->name, 6)))
 #define bfd_is_ind_section(sec) ((sec) == bfd_ind_section_ptr)
 
 #define bfd_is_const_section(SEC)              \
diff --git a/bfd/section.c b/bfd/section.c
index 7ee3f6915b..9517148032 100644
--- a/bfd/section.c
+++ b/bfd/section.c
@@ -597,7 +597,9 @@ CODE_FRAGMENT
 .#define bfd_ind_section_ptr (&_bfd_std_section[3])
 .
 .#define bfd_is_und_section(sec) ((sec) == bfd_und_section_ptr)
-.#define bfd_is_abs_section(sec) ((sec) == bfd_abs_section_ptr)
+.#define bfd_is_abs_section(sec)                \
+.  (((sec) == bfd_abs_section_ptr) ||		\
+.  (0 == strncmp (".__abs", sec->name, 6)))
 .#define bfd_is_ind_section(sec) ((sec) == bfd_ind_section_ptr)
 .
 .#define bfd_is_const_section(SEC)		\
-- 
2.11.0



More information about the Binutils mailing list