mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-22 02:50:08 +08:00
This fixes ! to work as documented in a memory region attribute list.
From Thomas Zenker <thz@lennartz-electronic.de>: * ldgram.y (attributes_opt): Use attributes_list instead of NAME. (attributes_list, attributes_string): New nonterminals. * ldlang.c (lang_set_flags): Add invert parameter. Don't handle '!'. * ldlang.c (lang_set_flags): Update declaration.
This commit is contained in:
@ -1,3 +1,12 @@
|
|||||||
|
1999-06-13 Ian Lance Taylor <ian@zembu.com>
|
||||||
|
|
||||||
|
From Thomas Zenker <thz@lennartz-electronic.de>:
|
||||||
|
* ldgram.y (attributes_opt): Use attributes_list instead of NAME.
|
||||||
|
(attributes_list, attributes_string): New nonterminals.
|
||||||
|
* ldlang.c (lang_set_flags): Add invert parameter. Don't handle
|
||||||
|
'!'.
|
||||||
|
* ldlang.c (lang_set_flags): Update declaration.
|
||||||
|
|
||||||
1999-06-12 Ian Lance Taylor <ian@zembu.com>
|
1999-06-12 Ian Lance Taylor <ian@zembu.com>
|
||||||
|
|
||||||
* emultempl/pe.em (gld_${EMULATION_NAME}_after_parse): Don't add
|
* emultempl/pe.em (gld_${EMULATION_NAME}_after_parse): Don't add
|
||||||
|
25
ld/ldgram.y
25
ld/ldgram.y
@ -1,5 +1,5 @@
|
|||||||
/* A YACC grammer to parse a superset of the AT&T linker scripting languaue.
|
/* A YACC grammer to parse a superset of the AT&T linker scripting languaue.
|
||||||
Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 1998
|
Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 1999
|
||||||
Free Software Foundation, Inc.
|
Free Software Foundation, Inc.
|
||||||
Written by Steve Chamberlain of Cygnus Support (steve@cygnus.com).
|
Written by Steve Chamberlain of Cygnus Support (steve@cygnus.com).
|
||||||
|
|
||||||
@ -132,7 +132,7 @@ static int error_index;
|
|||||||
%token ORIGIN FILL
|
%token ORIGIN FILL
|
||||||
%token LENGTH CREATE_OBJECT_SYMBOLS INPUT GROUP OUTPUT CONSTRUCTORS
|
%token LENGTH CREATE_OBJECT_SYMBOLS INPUT GROUP OUTPUT CONSTRUCTORS
|
||||||
%token ALIGNMOD AT PROVIDE
|
%token ALIGNMOD AT PROVIDE
|
||||||
%type <token> assign_op atype
|
%type <token> assign_op atype attributes_opt
|
||||||
%type <name> filename
|
%type <name> filename
|
||||||
%token CHIP LIST SECT ABSOLUTE LOAD NEWLINE ENDWORD ORDER NAMEWORD ASSERT_K
|
%token CHIP LIST SECT ABSOLUTE LOAD NEWLINE ENDWORD ORDER NAMEWORD ASSERT_K
|
||||||
%token FORMAT PUBLIC DEFSYMEND BASE ALIAS TRUNCATE REL
|
%token FORMAT PUBLIC DEFSYMEND BASE ALIAS TRUNCATE REL
|
||||||
@ -610,15 +610,24 @@ length_spec:
|
|||||||
"length",
|
"length",
|
||||||
lang_first_phase_enum);
|
lang_first_phase_enum);
|
||||||
}
|
}
|
||||||
|
;
|
||||||
|
|
||||||
attributes_opt:
|
attributes_opt:
|
||||||
'(' NAME ')'
|
/* empty */
|
||||||
{
|
{ /* dummy action to avoid bison 1.25 error message */ }
|
||||||
lang_set_flags(region, $2);
|
| '(' attributes_list ')'
|
||||||
}
|
;
|
||||||
|
|
|
||||||
|
|
||||||
|
attributes_list:
|
||||||
|
attributes_string
|
||||||
|
| attributes_list attributes_string
|
||||||
|
;
|
||||||
|
|
||||||
|
attributes_string:
|
||||||
|
NAME
|
||||||
|
{ lang_set_flags (region, $1, 0); }
|
||||||
|
| '!' NAME
|
||||||
|
{ lang_set_flags (region, $2, 1); }
|
||||||
;
|
;
|
||||||
|
|
||||||
startup:
|
startup:
|
||||||
|
11
ld/ldlang.c
11
ld/ldlang.c
@ -3255,21 +3255,18 @@ lang_place_orphans ()
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
lang_set_flags (ptr, flags)
|
lang_set_flags (ptr, flags, invert)
|
||||||
lang_memory_region_type *ptr;
|
lang_memory_region_type *ptr;
|
||||||
CONST char *flags;
|
CONST char *flags;
|
||||||
|
int invert;
|
||||||
{
|
{
|
||||||
flagword *ptr_flags = &ptr->flags;
|
flagword *ptr_flags;
|
||||||
|
|
||||||
ptr->flags = ptr->not_flags = 0;
|
ptr_flags = invert ? &ptr->not_flags : &ptr->flags;
|
||||||
while (*flags)
|
while (*flags)
|
||||||
{
|
{
|
||||||
switch (*flags)
|
switch (*flags)
|
||||||
{
|
{
|
||||||
case '!':
|
|
||||||
ptr_flags = (ptr_flags == &ptr->flags) ? &ptr->not_flags : &ptr->flags;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'A': case 'a':
|
case 'A': case 'a':
|
||||||
*ptr_flags |= SEC_ALLOC;
|
*ptr_flags |= SEC_ALLOC;
|
||||||
break;
|
break;
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
/* ldlang.h - linker command language support
|
/* ldlang.h - linker command language support
|
||||||
Copyright 1991, 92, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc.
|
Copyright 1991, 92, 93, 94, 95, 96, 97, 98, 1999
|
||||||
|
Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of GLD, the Gnu Linker.
|
This file is part of GLD, the Gnu Linker.
|
||||||
|
|
||||||
@ -383,7 +384,8 @@ extern struct memory_region_struct *lang_memory_region_lookup
|
|||||||
extern struct memory_region_struct *lang_memory_region_default
|
extern struct memory_region_struct *lang_memory_region_default
|
||||||
PARAMS ((asection *));
|
PARAMS ((asection *));
|
||||||
extern void lang_map PARAMS ((void));
|
extern void lang_map PARAMS ((void));
|
||||||
extern void lang_set_flags PARAMS ((lang_memory_region_type *, const char *));
|
extern void lang_set_flags PARAMS ((lang_memory_region_type *, const char *,
|
||||||
|
int));
|
||||||
extern void lang_add_output PARAMS ((const char *, int from_script));
|
extern void lang_add_output PARAMS ((const char *, int from_script));
|
||||||
extern void lang_enter_output_section_statement
|
extern void lang_enter_output_section_statement
|
||||||
PARAMS ((const char *output_section_statement_name,
|
PARAMS ((const char *output_section_statement_name,
|
||||||
|
Reference in New Issue
Block a user