diff options
author | Kai Tietz <kai.tietz@onevision.com> | 2013-01-25 11:39:42 +0000 |
---|---|---|
committer | Kai Tietz <kai.tietz@onevision.com> | 2013-01-25 11:39:42 +0000 |
commit | 0a4e6638daeca240a146c9b33219dffe1bd66afc (patch) | |
tree | 0ff0399dc9f0938e7f10356b9578550b3d17229c | |
parent | 9b8bf3211b48a1fc3259a2cbfced4d188f539945 (diff) | |
download | gdb-0a4e6638daeca240a146c9b33219dffe1bd66afc.zip gdb-0a4e6638daeca240a146c9b33219dffe1bd66afc.tar.gz gdb-0a4e6638daeca240a146c9b33219dffe1bd66afc.tar.bz2 |
* deffilep.y (def_image_name): Adjust type of base-address
argument.
(%union): Add new type bfd_vma as vma.
(VMA): New rule.
(opt_base): Use VMA instead of NUMBER rule to evaluate value.
(def_file_print): Use bfd's fprintf_vma to output base-address.
-rw-r--r-- | ld/ChangeLog | 9 | ||||
-rw-r--r-- | ld/deffilep.y | 20 |
2 files changed, 23 insertions, 6 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog index 3133595..e8bbc9b 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,12 @@ +2013-01-25 Kai Tietz <ktietz@redhat.com> + + * deffilep.y (def_image_name): Adjust type of base-address + argument. + (%union): Add new type bfd_vma as vma. + (VMA): New rule. + (opt_base): Use VMA instead of NUMBER rule to evaluate value. + (def_file_print): Use bfd's fprintf_vma to output base-address. + 2013-01-24 Nick Clifton <nickc@redhat.com> * NEWS: Mention support for V850E3V5 architecture. diff --git a/ld/deffilep.y b/ld/deffilep.y index cbc1714..9121f8f 100644 --- a/ld/deffilep.y +++ b/ld/deffilep.y @@ -94,7 +94,7 @@ static void def_exports (const char *, const char *, int, int, const char *); static void def_heapsize (int, int); static void def_import (const char *, const char *, const char *, const char *, int, const char *); -static void def_image_name (const char *, int, int); +static void def_image_name (const char *, bfd_vma, int); static void def_section (const char *, int); static void def_section_alt (const char *, const char *); static void def_stacksize (int, int); @@ -115,6 +115,7 @@ static const char *lex_parse_string_end = 0; char *id; const char *id_const; int number; + bfd_vma vma; char *digits; }; @@ -125,8 +126,9 @@ static const char *lex_parse_string_end = 0; %token <id> ID %token <digits> DIGITS %type <number> NUMBER +%type <vma> VMA opt_base %type <digits> opt_digits -%type <number> opt_base opt_ordinal +%type <number> opt_ordinal %type <number> attr attr_list opt_number exp_opt_list exp_opt %type <id> opt_name opt_name2 opt_equal_name anylang_id opt_id %type <id> opt_equalequal_name @@ -312,8 +314,8 @@ opt_equal_name: | { $$ = 0; } ; -opt_base: BASE '=' NUMBER { $$ = $3;} - | { $$ = -1;} +opt_base: BASE '=' VMA { $$ = $3;} + | { $$ = (bfd_vma) -1;} ; anylang_id: ID { $$ = $1; } @@ -340,6 +342,8 @@ opt_id: ID { $$ = $1; } ; NUMBER: DIGITS { $$ = strtoul ($1, 0, 0); } + ; +VMA: DIGITS { $$ = (bfd_vma) strtoull ($1, 0, 0); } %% @@ -509,7 +513,11 @@ def_file_print (FILE *file, def_file *fdef) if (fdef->is_dll != -1) fprintf (file, " is dll: %s\n", fdef->is_dll ? "yes" : "no"); if (fdef->base_address != (bfd_vma) -1) - fprintf (file, " base address: 0x%08x\n", fdef->base_address); + { + fprintf (file, " base address: 0x"); + fprintf_vma (file, fdef->base_address); + fprintf (file, "\n"); + } if (fdef->description) fprintf (file, " description: `%s'\n", fdef->description); if (fdef->stack_reserve != -1) @@ -946,7 +954,7 @@ def_file_add_directive (def_file *my_def, const char *param, int len) /* Parser Callbacks. */ static void -def_image_name (const char *name, int base, int is_dll) +def_image_name (const char *name, bfd_vma base, int is_dll) { /* If a LIBRARY or NAME statement is specified without a name, there is nothing to do here. We retain the output filename specified on command line. */ |