Skip to content

Commit fe45eab

Browse files
committed
Patch BFD to remove strncmp usage, so that GDB is built with ELF support
Signed-off-by: Alice Ziuziakowska <[email protected]>
1 parent 7471191 commit fe45eab

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

patches/binutils/001-bfd-elf.patch

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h
2+
index 15767245..d7662e0f 100644
3+
--- a/bfd/elf-bfd.h
4+
+++ b/bfd/elf-bfd.h
5+
@@ -3066,7 +3066,13 @@ static inline bfd_boolean
6+
bfd_section_is_ctf (const asection *sec)
7+
{
8+
const char *name = bfd_section_name (sec);
9+
- return strncmp (name, ".ctf", 4) == 0 && (name[4] == 0 || name[4] == '.');
10+
+
11+
+ return (
12+
+ name[0] == '.'
13+
+ && name[1] == 'c'
14+
+ && name[2] == 't'
15+
+ && name[3] == 'f'
16+
+ && (name[4] == 0 || name[4] == '.'));
17+
}
18+
19+
#ifdef __cplusplus

0 commit comments

Comments
 (0)