diff options
author | Nick Clifton <nickc@redhat.com> | 2015-02-27 16:19:57 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2015-02-27 16:19:57 +0000 |
commit | f0673d2040a49ecebfc0d3a03993d09fb4dd3e17 (patch) | |
tree | 0f0c6e5557e84ffa549a9c89ae979ccec65cd609 /ld | |
parent | 07697489f4587e41f4f63aa526c1bd7d2fcd5494 (diff) | |
download | gdb-f0673d2040a49ecebfc0d3a03993d09fb4dd3e17.zip gdb-f0673d2040a49ecebfc0d3a03993d09fb4dd3e17.tar.gz gdb-f0673d2040a49ecebfc0d3a03993d09fb4dd3e17.tar.bz2 |
Fixes a problem with the linker script parser not always handling the ! character in memort region attributes.
PR ld/17900
* ldlang.c (lang_set_flags): Allow exclamation mark to reverse the
sense of the following memory region attribute characters.
Diffstat (limited to 'ld')
-rw-r--r-- | ld/ChangeLog | 6 | ||||
-rw-r--r-- | ld/ldlang.c | 10 |
2 files changed, 15 insertions, 1 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog index 7db30ea..65aadc0 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,9 @@ +2015-02-27 Nick Clifton <nickc@redhat.com> + + PR ld/17900 + * ldlang.c (lang_set_flags): Allow exclamation mark to reverse the + sense of the following memory region attribute characters. + 2015-02-27 Alan Modra <amodra@gmail.com> * Makefile.am (ALL_EMULATION_SOURCES): Sort new h8300 entries. diff --git a/ld/ldlang.c b/ld/ldlang.c index ce333b4..8880821 100644 --- a/ld/ldlang.c +++ b/ld/ldlang.c @@ -6125,10 +6125,18 @@ lang_set_flags (lang_memory_region_type *ptr, const char *flags, int invert) flagword *ptr_flags; ptr_flags = invert ? &ptr->not_flags : &ptr->flags; + while (*flags) { switch (*flags) { + /* PR 17900: An exclamation mark in the attributes reverses + the sense of any of the attributes that follow. */ + case '!': + invert = ! invert; + ptr_flags = invert ? &ptr->not_flags : &ptr->flags; + break; + case 'A': case 'a': *ptr_flags |= SEC_ALLOC; break; @@ -6151,7 +6159,7 @@ lang_set_flags (lang_memory_region_type *ptr, const char *flags, int invert) break; default: - einfo (_("%P%F: invalid syntax in flags\n")); + einfo (_("%P%F: invalid character %c (%d) in flags\n"), * flags, * flags); break; } flags++; |