Fixes a problem with the linker script parser not always handling the ! character...
authorNick Clifton <nickc@redhat.com>
Fri, 27 Feb 2015 16:19:57 +0000 (16:19 +0000)
committerNick Clifton <nickc@redhat.com>
Fri, 27 Feb 2015 16:19:57 +0000 (16:19 +0000)
PR ld/17900
* ldlang.c (lang_set_flags): Allow exclamation mark to reverse the
sense of the following memory region attribute characters.

ld/ChangeLog
ld/ldlang.c

index 7db30ea619819cca5de4aaf702024c1b14abb61a..65aadc0d31937855751a01174dc40e701a51486d 100644 (file)
@@ -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.
index ce333b426cd9370580bbe8d2870eb1cc85b4fd27..888082147a1794cfd096fe306d05f2a82d55f6a2 100644 (file)
@@ -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++;
This page took 0.029474 seconds and 4 git commands to generate.