From 0112cd268b205d8176b8b4d00988a334822956cf Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Sat, 16 Sep 2006 18:12:17 +0000 Subject: * bfd-in.h (STRING_AND_COMMA): New macro. Takes one constant string as its argument and emits the string followed by a comma and then the length of the string. (CONST_STRNEQ): New macro. Checks to see if a variable string has a constant string as its initial characters. (CONST_STRNCPY): New macro. Copies a constant string to the start of a variable string. * bfd-in2.h: Regenerate. * : Make use of the new macros. --- ld/ldwrite.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'ld/ldwrite.c') diff --git a/ld/ldwrite.c b/ld/ldwrite.c index ee9d74a796d..6c8152db50c 100644 --- a/ld/ldwrite.c +++ b/ld/ldwrite.c @@ -1,6 +1,6 @@ /* ldwrite.c -- write out the linked file Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2000, 2002, - 2003, 2004, 2005 Free Software Foundation, Inc. + 2003, 2004, 2005, 2006 Free Software Foundation, Inc. Written by Steve Chamberlain sac@cygnus.com This file is part of GLD, the Gnu Linker. @@ -293,7 +293,7 @@ build_link_order (lang_statement_union_type *statement) static bfd_boolean unsplittable_name (const char *name) { - if (strncmp (name, ".stab", 5) == 0) + if (CONST_STRNEQ (name, ".stab")) { /* There are several stab like string sections. We pattern match on ".stab...str" */ @@ -338,7 +338,7 @@ clone_section (bfd *abfd, asection *s, const char *name, int *count) { /* Some section names cannot be truncated, as the name is used to locate some other section. */ - if (strncmp (name, ".stab", 5) == 0 + if (CONST_STRNEQ (name, ".stab") || strcmp (name, "$GDB_SYMBOLS$") == 0) { einfo (_ ("%F%P: cannot create split section name for %s\n"), name); -- cgit v1.2.1