aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1997-08-20 15:24:15 +0000
committerIan Lance Taylor <ian@airs.com>1997-08-20 15:24:15 +0000
commit9f19768a57a5bd92ae90ad4fbc59b0a397ec75fc (patch)
treec378080e1f592e915e52f788b636171c51dee19b /ld
parent72068e8ec06a398cd82a3140b0ae069df2cfeac9 (diff)
downloadgdb-9f19768a57a5bd92ae90ad4fbc59b0a397ec75fc.zip
gdb-9f19768a57a5bd92ae90ad4fbc59b0a397ec75fc.tar.gz
gdb-9f19768a57a5bd92ae90ad4fbc59b0a397ec75fc.tar.bz2
* ldlang.c (wildcardp): Don't let a backslash by itself cause a
pattern to be treated as a wildcard pattern. PR 13113.
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog3
-rw-r--r--ld/ldlang.c67
2 files changed, 44 insertions, 26 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 6541492..0a221e5 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,5 +1,8 @@
Wed Aug 20 11:14:13 1997 Ian Lance Taylor <ian@cygnus.com>
+ * ldlang.c (wildcardp): Don't let a backslash by itself cause a
+ pattern to be treated as a wildcard pattern.
+
* ldgram.y (atype): Accept parentheses with no type.
* ld.texinfo (Section Definition): Clarify use of whitespace.
diff --git a/ld/ldlang.c b/ld/ldlang.c
index aaf09e2..66b3590 100644
--- a/ld/ldlang.c
+++ b/ld/ldlang.c
@@ -21,6 +21,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "bfd.h"
#include "sysdep.h"
#include "libiberty.h"
+#include "obstack.h"
#include "bfdlink.h"
#include "ld.h"
@@ -736,7 +737,11 @@ section_already_linked (abfd, sec, data)
explicit actions, like foo.o(.text), bar.o(.text) and
foo.o(.text, .data). */
-/* Return true if the PATTERN argument is a wildcard pattern. */
+/* Return true if the PATTERN argument is a wildcard pattern.
+ Although backslashes are treated specially if a pattern contains
+ wildcards, we do not consider the mere presence of a backslash to
+ be enough to cause the the pattern to be treated as a wildcard.
+ That lets us handle DOS filenames more naturally. */
static boolean
wildcardp (pattern)
@@ -746,7 +751,6 @@ wildcardp (pattern)
for (s = pattern; *s != '\0'; ++s)
if (*s == '?'
- || *s == '\\'
|| *s == '*'
|| *s == '[')
return true;
@@ -1366,7 +1370,7 @@ lang_place_undefineds ()
h = bfd_link_hash_lookup (link_info.hash, ptr->name, true, false, true);
if (h == (struct bfd_link_hash_entry *) NULL)
- einfo ("%P%F: bfd_link_hash_lookup failed: %E");
+ einfo ("%P%F: bfd_link_hash_lookup failed: %E\n");
if (h->type == bfd_link_hash_new)
{
h->type = bfd_link_hash_undefined;
@@ -1671,6 +1675,10 @@ print_data_statement (data)
size = QUAD_SIZE;
name = "QUAD";
break;
+ case SQUAD:
+ size = QUAD_SIZE;
+ name = "SQUAD";
+ break;
}
minfo ("0x%V %W %s 0x%v", addr, size, name, data->value);
@@ -2046,7 +2054,7 @@ lang_size_sections (s, output_section_statement, prev, fill, dot, relax)
if (os->children.head == NULL
|| os->children.head->next != NULL
|| os->children.head->header.type != lang_input_section_enum)
- einfo ("%P%X: Internal error on COFF shared library section %s",
+ einfo ("%P%X: Internal error on COFF shared library section %s\n",
os->name);
input = os->children.head->input_section.section;
@@ -2176,21 +2184,22 @@ lang_size_sections (s, output_section_statement, prev, fill, dot, relax)
output_section_statement->bfd_section;
switch (s->data_statement.type)
- {
- case QUAD:
- size = QUAD_SIZE;
- break;
- case LONG:
- size = LONG_SIZE;
- break;
- case SHORT:
- size = SHORT_SIZE;
- break;
- case BYTE:
- size = BYTE_SIZE;
- break;
+ {
+ case QUAD:
+ case SQUAD:
+ size = QUAD_SIZE;
+ break;
+ case LONG:
+ size = LONG_SIZE;
+ break;
+ case SHORT:
+ size = SHORT_SIZE;
+ break;
+ case BYTE:
+ size = BYTE_SIZE;
+ break;
+ }
- }
dot += size;
output_section_statement->bfd_section->_raw_size += size;
/* The output section gets contents, and then we inspect for
@@ -2414,6 +2423,7 @@ lang_do_assignments (s, output_section_statement, fill, dot)
switch (s->data_statement.type)
{
case QUAD:
+ case SQUAD:
dot += QUAD_SIZE;
break;
case LONG:
@@ -2621,8 +2631,10 @@ lang_check ()
bfd_printable_name (input_bfd), input_bfd,
bfd_printable_name (output_bfd));
- else
- bfd_merge_private_bfd_data (input_bfd, output_bfd);
+ else if (! bfd_merge_private_bfd_data (input_bfd, output_bfd))
+ {
+ einfo ("%E%X: failed to merge target specific data of file %B\n", input_bfd);
+ }
}
}
@@ -3082,6 +3094,13 @@ lang_process ()
ldemul_after_open ();
+ /* Make sure that we're not mixing architectures. We call this
+ after all the input files have been opened, but before we do any
+ other processing, so that any operations merge_private_bfd_data
+ does on the output file will be known during the rest of the
+ link. */
+ lang_check ();
+
/* Build all sets based on the information gathered from the input
files. */
ldctor_build_sets ();
@@ -3089,14 +3108,14 @@ lang_process ()
/* Size up the common data */
lang_common ();
- /* Run through the contours of the script and attatch input sections
+ /* Run through the contours of the script and attach input sections
to the correct output sections
*/
map_input_to_output_sections (statement_list.head, (char *) NULL,
(lang_output_section_statement_type *) NULL);
- /* Find any sections not attatched explicitly and handle them */
+ /* Find any sections not attached explicitly and handle them */
lang_place_orphans ();
ldemul_before_allocation ();
@@ -3157,10 +3176,6 @@ lang_process ()
abs_output_section,
(fill_type) 0, (bfd_vma) 0);
- /* Make sure that we're not mixing architectures */
-
- lang_check ();
-
/* Final stuffs */
ldemul_finish ();