]> Git Repo - binutils.git/blob - ld/ldexp.c
Add embedded PowerPC ELF support.
[binutils.git] / ld / ldexp.c
1 /* This module handles expression trees.
2 Copyright (C) 1991, 1993 Free Software Foundation, Inc.
3 Written by Steve Chamberlain of Cygnus Support ([email protected]).
4
5 This file is part of GLD, the Gnu Linker.
6
7 GLD is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2, or (at your option)
10 any later version.
11
12 GLD is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with GLD; see the file COPYING.  If not, write to
19 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
20
21 /*
22 This module is in charge of working out the contents of expressions.
23
24 It has to keep track of the relative/absness of a symbol etc. This is
25 done by keeping all values in a struct (an etree_value_type) which
26 contains a value, a section to which it is relative and a valid bit.
27
28 */
29
30
31 #include "bfd.h"
32 #include "sysdep.h"
33 #include "bfdlink.h"
34
35 #include "ld.h"
36 #include "ldmain.h"
37 #include "ldmisc.h"
38 #include "ldexp.h"
39 #include "ldgram.h"
40 #include "ldlang.h"
41
42 static void exp_print_token PARAMS ((token_code_type code));
43 static void make_abs PARAMS ((etree_value_type *ptr));
44 static etree_value_type new_abs PARAMS ((bfd_vma value));
45 static void check PARAMS ((lang_output_section_statement_type *os,
46                            const char *name, const char *op));
47 static etree_value_type new_rel
48   PARAMS ((bfd_vma value, lang_output_section_statement_type *section));
49 static etree_value_type new_rel_from_section
50   PARAMS ((bfd_vma value, lang_output_section_statement_type *section));
51 static etree_value_type fold_binary
52   PARAMS ((etree_type *tree,
53            lang_output_section_statement_type *current_section,
54            lang_phase_type allocation_done,
55            bfd_vma dot, bfd_vma *dotp));
56 static etree_value_type fold_name
57   PARAMS ((etree_type *tree,
58            lang_output_section_statement_type *current_section,
59            lang_phase_type allocation_done,
60            bfd_vma dot));
61 static etree_value_type exp_fold_tree_no_dot
62   PARAMS ((etree_type *tree,
63            lang_output_section_statement_type *current_section,
64            lang_phase_type allocation_done));
65
66 static void
67 exp_print_token (code)
68      token_code_type code;
69 {
70   static CONST struct
71     {
72       token_code_type code;
73       char *name;
74     } table[] =
75       {
76         { INT,  "int" },
77         { REL, "relocateable" },
78         { NAME,"NAME" },
79         { PLUSEQ,"+=" },
80         { MINUSEQ,"-=" },
81         { MULTEQ,"*=" },
82         { DIVEQ,"/=" },
83         { LSHIFTEQ,"<<=" },
84         { RSHIFTEQ,">>=" },
85         { ANDEQ,"&=" },
86         { OREQ,"|=" },
87         { OROR,"||" },
88         { ANDAND,"&&" },
89         { EQ,"==" },
90         { NE,"!=" },
91         { LE,"<=" },
92         { GE,">=" },
93         { LSHIFT,"<<" },
94         { RSHIFT,">>=" },
95         { ALIGN_K,"ALIGN" },
96         { BLOCK,"BLOCK" },
97         { SECTIONS,"SECTIONS" },
98         { SIZEOF_HEADERS,"SIZEOF_HEADERS" },
99         { NEXT,"NEXT" },
100         { SIZEOF,"SIZEOF" },
101         { ADDR,"ADDR" },
102         { MEMORY,"MEMORY" },
103         { DEFINED,"DEFINED" },
104         { TARGET_K,"TARGET" },
105         { SEARCH_DIR,"SEARCH_DIR" },
106         { MAP,"MAP" },
107         { QUAD,"QUAD" },
108         { LONG,"LONG" },
109         { SHORT,"SHORT" },
110         { BYTE,"BYTE" },
111         { ENTRY,"ENTRY" },
112         { 0,(char *)NULL }
113       };
114   unsigned int idx;
115
116   for (idx = 0; table[idx].name != (char*)NULL; idx++) {
117     if (table[idx].code == code) {
118       fprintf(config.map_file, "%s", table[idx].name);
119       return;
120     }
121   }
122   /* Not in table, just print it alone */
123   fprintf(config.map_file, "%c",code);
124 }
125
126 static void 
127 make_abs (ptr)
128      etree_value_type *ptr;
129 {
130     asection *s = ptr->section->bfd_section;
131     ptr->value += s->vma;
132     ptr->section = abs_output_section;
133 }
134
135 static etree_value_type
136 new_abs (value)
137      bfd_vma value;
138 {
139   etree_value_type new;
140   new.valid = true;
141   new.section = abs_output_section;
142   new.value = value;
143   return new;
144 }
145
146 static void 
147 check (os, name, op)
148      lang_output_section_statement_type *os;
149      CONST char *name;
150      CONST char *op;
151 {
152   if (os == (lang_output_section_statement_type *)NULL) {
153     einfo("%F%P: %s uses undefined section %s\n", op, name);
154   }
155   if (os->processed == false) {
156     einfo("%F%P: %s forward reference of section %s\n",op, name);
157   }
158 }
159
160 etree_type *
161 exp_intop (value)
162      bfd_vma value;
163 {
164   etree_type *new = (etree_type *)stat_alloc((bfd_size_type)(sizeof(new->value)));
165   new->type.node_code = INT;
166   new->value.value = value;
167   new->type.node_class = etree_value;
168   return new;
169
170 }
171
172 /* Build an expression representing an unnamed relocateable value.  */
173
174 etree_type *
175 exp_relop (section, value)
176      asection *section;
177      bfd_vma value;
178 {
179   etree_type *new = (etree_type *) stat_alloc (sizeof (new->rel));
180   new->type.node_code = REL;
181   new->type.node_class = etree_rel;
182   new->rel.section = section;
183   new->rel.value = value;
184   return new;
185 }
186
187 static etree_value_type
188 new_rel (value, section)
189      bfd_vma value;
190      lang_output_section_statement_type *section;
191 {
192   etree_value_type new;
193   new.valid = true;
194   new.value = value;
195   new.section = section;
196   return new;
197 }
198
199 static etree_value_type
200 new_rel_from_section (value, section)
201      bfd_vma value;
202      lang_output_section_statement_type *section;
203 {
204   etree_value_type new;
205   new.valid = true;
206   new.value = value;
207   new.section = section;
208
209     new.value -= section->bfd_section->vma;
210
211   return new;
212 }
213
214 static etree_value_type 
215 fold_binary (tree, current_section, allocation_done, dot, dotp)
216      etree_type *tree;
217      lang_output_section_statement_type *current_section;
218      lang_phase_type  allocation_done;
219      bfd_vma dot;
220      bfd_vma *dotp;
221 {
222   etree_value_type result;
223
224   result =  exp_fold_tree(tree->binary.lhs,  current_section,
225                           allocation_done, dot, dotp);
226   if (result.valid) {
227     etree_value_type other;
228     other = exp_fold_tree(tree->binary.rhs,
229                           current_section,
230                           allocation_done, dot,dotp) ;
231     if (other.valid) {
232         /* If values are from different sections, or this is an */
233         /* absolute expression, make both source args absolute */
234       if (result.section !=  other.section ||
235           current_section == abs_output_section) 
236       {
237         make_abs(&result);
238         make_abs(&other);
239       }
240           
241       switch (tree->type.node_code) 
242         {
243         case '%':
244           /* Mod,  both absolule*/
245
246           if (other.value == 0) {
247             einfo("%F%S %% by zero\n");
248           }
249           result.value = (int)result.value % (int)other.value;
250           break;
251         case '/':
252           if (other.value == 0) {
253             einfo("%F%S / by zero\n");
254           }
255           result.value = (int)result.value / (int) other.value;
256           break;
257 #define BOP(x,y) case x : result.value = result.value y other.value;break;
258           BOP('+',+);
259           BOP('*',*);
260           BOP('-',-);
261           BOP(LSHIFT,<<);
262           BOP(RSHIFT,>>);
263           BOP(EQ,==);
264           BOP(NE,!=);
265           BOP('<',<);
266           BOP('>',>);
267           BOP(LE,<=);
268           BOP(GE,>=);
269           BOP('&',&);
270           BOP('^',^);
271           BOP('|',|);
272           BOP(ANDAND,&&);
273           BOP(OROR,||);
274         default:
275           FAIL();
276         }
277     }
278     else {
279       result.valid = false;
280     }
281   }
282   return result;
283 }
284 etree_value_type 
285 invalid ()
286 {
287   etree_value_type new;
288   new.valid = false;
289   return new;
290 }
291
292 static etree_value_type 
293 fold_name (tree, current_section, allocation_done, dot)
294      etree_type *tree;
295      lang_output_section_statement_type *current_section;
296      lang_phase_type  allocation_done;
297      bfd_vma dot;
298 {
299   etree_value_type result;
300   switch (tree->type.node_code) 
301       {
302       case SIZEOF_HEADERS:
303         if (allocation_done != lang_first_phase_enum) 
304           {
305             result = new_abs ((bfd_vma)
306                               bfd_sizeof_headers (output_bfd,
307                                                   link_info.relocateable));
308           }
309         else
310           {
311             result.valid = false;
312           }
313         break;
314       case DEFINED:
315         {
316           struct bfd_link_hash_entry *h;
317
318           h = bfd_link_hash_lookup (link_info.hash, tree->name.name,
319                                     false, false, true);
320           result.value = (h != (struct bfd_link_hash_entry *) NULL
321                           && (h->type == bfd_link_hash_defined
322                               || h->type == bfd_link_hash_common));
323           result.section = 0;
324           result.valid = true;
325         }
326         break;
327       case NAME:
328         result.valid = false;
329         if (tree->name.name[0] == '.' && tree->name.name[1] == 0)
330           {
331             if (allocation_done != lang_first_phase_enum)
332               result = new_rel_from_section(dot, current_section);
333             else
334               result = invalid();
335           }
336         else if (allocation_done == lang_final_phase_enum)
337           {
338             struct bfd_link_hash_entry *h;
339
340             h = bfd_link_hash_lookup (link_info.hash, tree->name.name,
341                                       false, false, true);
342             if (h != (struct bfd_link_hash_entry *) NULL
343                 && h->type == bfd_link_hash_defined)
344               {
345                 lang_output_section_statement_type *os;
346                 
347                 os = (lang_output_section_statement_lookup
348                       (h->u.def.section->output_section->name));
349
350                 /* FIXME: Is this correct if this section is being
351                    linked with -R?  */
352                 result = new_rel ((h->u.def.value
353                                    + h->u.def.section->output_offset),
354                                   os);
355               }
356             if (result.valid == false)
357               einfo("%F%S: undefined symbol `%s' referenced in expression\n",
358                     tree->name.name);
359           }
360         break;
361
362       case ADDR:
363
364         if (allocation_done != lang_first_phase_enum) {
365           lang_output_section_statement_type *os =
366             lang_output_section_find(tree->name.name);
367           check(os,tree->name.name,"ADDR");
368           result =    new_rel((bfd_vma)0,  os);
369         }
370         else {
371           result = invalid();
372         }
373         break;
374       case SIZEOF:
375         if(allocation_done != lang_first_phase_enum) {
376           lang_output_section_statement_type *os = 
377             lang_output_section_find(tree->name.name);
378           check(os,tree->name.name,"SIZEOF");
379           result = new_abs((bfd_vma)(os->bfd_section->_raw_size));
380         }
381         else {
382           result = invalid();
383         }
384         break;
385
386       default:
387         FAIL();
388         break;
389       }
390
391   return result;
392 }
393 etree_value_type 
394 exp_fold_tree (tree, current_section, allocation_done, dot, dotp)
395      etree_type *tree;
396      lang_output_section_statement_type *current_section;
397      lang_phase_type  allocation_done;
398      bfd_vma dot;
399      bfd_vma *dotp;
400 {
401   etree_value_type result;
402
403   if (tree == (etree_type *)NULL) {
404     result.valid = false;
405   }
406   else {
407     switch (tree->type.node_class) 
408     {
409      case etree_value:
410       result = new_rel(tree->value.value, current_section);
411       break;
412     case etree_rel:
413       if (allocation_done != lang_final_phase_enum)
414         result.valid = false;
415       else
416         result = new_rel ((tree->rel.value
417                            + tree->rel.section->output_section->vma
418                            + tree->rel.section->output_offset),
419                           current_section);
420       break;
421      case etree_unary:
422       result = exp_fold_tree(tree->unary.child,
423                              current_section,
424                              allocation_done, dot, dotp);
425       if (result.valid == true)
426       {
427         switch(tree->type.node_code) 
428         {
429          case ALIGN_K:
430           if (allocation_done != lang_first_phase_enum) {
431             result = new_rel_from_section(ALIGN_N(dot,
432                                                 result.value) ,
433                                           current_section);
434
435           }
436           else {
437             result.valid = false;
438           }
439           break;
440          case ABSOLUTE:
441           if (allocation_done != lang_first_phase_enum) 
442           {
443             if (current_section 
444                 == (lang_output_section_statement_type*)NULL) 
445             {
446               /* Outside a section, so it's all ok */
447
448             }
449             else {
450               /* Inside a section, subtract the base of the section,
451                  so when it's added again (in an assignment), everything comes out fine
452                  */
453               result.section = abs_output_section;
454               result.value -= current_section->bfd_section->vma;
455               result.valid = true;
456             }
457           }
458           else 
459           {
460             result.valid = false;
461           }
462
463           break;
464          case '~':
465           make_abs(&result);
466           result.value = ~result.value;
467           break;
468          case '!':
469           make_abs(&result);
470           result.value = !result.value;
471           break;
472          case '-':
473           make_abs(&result);
474           result.value = -result.value;
475           break;
476          case NEXT:
477           if (allocation_done ==lang_allocating_phase_enum) {
478             make_abs(&result);
479             result.value = ALIGN_N(dot, result.value);
480           }
481           else {
482             /* Return next place aligned to value */
483             result.valid = false;
484           }
485           break;
486          default:
487           FAIL();
488         }
489       }
490
491       break;
492      case etree_trinary:
493
494       result = exp_fold_tree(tree->trinary.cond,
495                              current_section,
496                              allocation_done, dot, dotp);
497       if (result.valid) {
498         result = exp_fold_tree(result.value ?
499                                tree->trinary.lhs:tree->trinary.rhs,
500                                current_section,
501                                allocation_done, dot, dotp);
502       }
503
504       break;
505      case etree_binary:
506       result = fold_binary(tree, current_section, allocation_done,
507                            dot, dotp);
508       break;
509      case etree_assign:
510      case etree_provide:
511       if (tree->assign.dst[0] == '.' && tree->assign.dst[1] == 0) {
512         /* Assignment to dot can only be done during allocation */
513         if (tree->type.node_class == etree_provide)
514           einfo ("%F%S can not PROVIDE assignment to location counter\n");
515         if (allocation_done == lang_allocating_phase_enum) {
516           result = exp_fold_tree(tree->assign.src,
517                                  current_section,
518                                  lang_allocating_phase_enum, dot, dotp);
519           if (result.valid == false) {
520             einfo("%F%S invalid assignment to location counter\n");
521           }
522           else {
523             if (current_section ==
524                 (lang_output_section_statement_type  *)NULL) {
525               einfo("%F%S assignment to location counter invalid outside of SECTION\n");
526             }
527             else {
528               bfd_vma nextdot =result.value +
529                current_section->bfd_section->vma;
530               if (nextdot < dot) {
531                 einfo("%F%S cannot move location counter backwards (from %V to %V)\n", dot, nextdot);
532               }
533               else {
534                 *dotp = nextdot; 
535               }
536             }
537           }
538         }
539       }
540       else
541         {
542           result = exp_fold_tree (tree->assign.src,
543                                   current_section, allocation_done,
544                                   dot, dotp);
545           if (result.valid)
546             {
547               struct bfd_link_hash_entry *h;
548
549               h = bfd_link_hash_lookup (link_info.hash, tree->assign.dst,
550                                         (tree->type.node_class == etree_assign
551                                          ? true : false),
552                                         false, false);
553               if (h == (struct bfd_link_hash_entry *) NULL)
554                 {
555                   if (tree->type.node_class == etree_assign)
556                     einfo ("%P%F:%s: hash creation failed\n",
557                            tree->assign.dst);
558                 }
559               else if (tree->type.node_class == etree_provide
560                        && h->type != bfd_link_hash_undefined
561                        && h->type != bfd_link_hash_common)
562                 {
563                   /* Do nothing.  The symbol was defined by some
564                      object.  */
565                 }
566               else
567                 {
568                   /* FIXME: Should we worry if the symbol is already
569                      defined?  */
570                   h->type = bfd_link_hash_defined;
571                   h->u.def.value = result.value;
572                   h->u.def.section = result.section->bfd_section;
573                 }
574             }
575         }  
576       break;
577      case etree_name:
578       result = fold_name(tree, current_section, allocation_done, dot);
579       break;
580      default:
581       einfo("%F%S need more of these %d\n",tree->type.node_class );
582
583     }
584   }
585
586   return result;
587 }
588
589
590 static etree_value_type 
591 exp_fold_tree_no_dot (tree, current_section, allocation_done)
592      etree_type *tree;
593      lang_output_section_statement_type *current_section;
594      lang_phase_type allocation_done;
595 {
596 return exp_fold_tree(tree, current_section, allocation_done, (bfd_vma)
597                      0, (bfd_vma *)NULL);
598 }
599
600 etree_type *
601 exp_binop (code, lhs, rhs)
602      int code;
603      etree_type *lhs;
604      etree_type *rhs;
605 {
606   etree_type value, *new;
607   etree_value_type r;
608
609   value.type.node_code = code;
610   value.binary.lhs = lhs;
611   value.binary.rhs = rhs;
612   value.type.node_class = etree_binary;
613   r = exp_fold_tree_no_dot(&value,
614                            abs_output_section,
615                            lang_first_phase_enum );
616   if (r.valid)
617     {
618       return exp_intop(r.value);
619     }
620   new = (etree_type *)stat_alloc((bfd_size_type)(sizeof(new->binary)));
621   memcpy((char *)new, (char *)&value, sizeof(new->binary));
622   return new;
623 }
624
625 etree_type *
626 exp_trinop (code, cond, lhs, rhs)
627      int code;
628      etree_type *cond;
629      etree_type *lhs;
630      etree_type *rhs;
631 {
632   etree_type value, *new;
633   etree_value_type r;
634   value.type.node_code = code;
635   value.trinary.lhs = lhs;
636   value.trinary.cond = cond;
637   value.trinary.rhs = rhs;
638   value.type.node_class = etree_trinary;
639   r= exp_fold_tree_no_dot(&value,  (lang_output_section_statement_type
640                                     *)NULL,lang_first_phase_enum);
641   if (r.valid) {
642     return exp_intop(r.value);
643   }
644   new = (etree_type *)stat_alloc((bfd_size_type)(sizeof(new->trinary)));
645   memcpy((char *)new,(char *) &value, sizeof(new->trinary));
646   return new;
647 }
648
649
650 etree_type *
651 exp_unop (code, child)
652      int code;
653      etree_type *child;
654 {
655   etree_type value, *new;
656
657   etree_value_type r;
658   value.unary.type.node_code = code;
659   value.unary.child = child;
660   value.unary.type.node_class = etree_unary;
661   r = exp_fold_tree_no_dot(&value,abs_output_section,
662                            lang_first_phase_enum);
663   if (r.valid) {
664     return exp_intop(r.value);
665   }
666   new = (etree_type *)stat_alloc((bfd_size_type)(sizeof(new->unary)));
667   memcpy((char *)new, (char *)&value, sizeof(new->unary));
668   return new;
669 }
670
671
672 etree_type *
673 exp_nameop (code, name)
674      int code;
675      CONST char *name;
676 {
677   etree_type value, *new;
678   etree_value_type r;
679   value.name.type.node_code = code;
680   value.name.name = name;
681   value.name.type.node_class = etree_name;
682
683
684   r = exp_fold_tree_no_dot(&value,
685                            (lang_output_section_statement_type *)NULL,
686                            lang_first_phase_enum);
687   if (r.valid) {
688     return exp_intop(r.value);
689   }
690   new = (etree_type *)stat_alloc((bfd_size_type)(sizeof(new->name)));
691   memcpy((char *)new, (char *)&value, sizeof(new->name));
692   return new;
693
694 }
695
696
697
698
699 etree_type *
700 exp_assop (code, dst, src)
701      int code;
702      CONST char *dst;
703      etree_type *src;
704 {
705   etree_type value, *new;
706
707   value.assign.type.node_code = code;
708
709
710   value.assign.src = src;
711   value.assign.dst = dst;
712   value.assign.type.node_class = etree_assign;
713
714 #if 0
715   if (exp_fold_tree_no_dot(&value, &result)) {
716     return exp_intop(result);
717   }
718 #endif
719   new = (etree_type*)stat_alloc((bfd_size_type)(sizeof(new->assign)));
720   memcpy((char *)new, (char *)&value, sizeof(new->assign));
721   return new;
722 }
723
724 /* Handle PROVIDE.  */
725
726 etree_type *
727 exp_provide (dst, src)
728      const char *dst;
729      etree_type *src;
730 {
731   etree_type *n;
732
733   n = (etree_type *) stat_alloc (sizeof (n->assign));
734   n->assign.type.node_code = '=';
735   n->assign.type.node_class = etree_provide;
736   n->assign.src = src;
737   n->assign.dst = dst;
738   return n;
739 }
740
741 void 
742 exp_print_tree (tree)
743      etree_type *tree;
744 {
745   switch (tree->type.node_class) {
746   case etree_value:
747     print_address(tree->value.value);
748     return;
749   case etree_rel:
750     if (tree->rel.section->owner != NULL)
751       fprintf (config.map_file, "%s:",
752                bfd_get_filename (tree->rel.section->owner));
753     fprintf (config.map_file, "%s+", tree->rel.section->name);
754     print_address (tree->rel.value);
755     return;
756   case etree_assign:
757 #if 0
758     if (tree->assign.dst->sdefs != (asymbol *)NULL){
759       fprintf(config.map_file,"%s (%x) ",tree->assign.dst->name,
760               tree->assign.dst->sdefs->value);
761     }
762     else {
763       fprintf(config.map_file,"%s (UNDEFINED)",tree->assign.dst->name);
764     }
765 #endif
766     fprintf(config.map_file,"%s ",tree->assign.dst);
767     exp_print_token(tree->type.node_code);
768     exp_print_tree(tree->assign.src);
769     break;
770   case etree_provide:
771     fprintf (config.map_file, "PROVIDE (%s, ", tree->assign.dst);
772     exp_print_tree (tree->assign.src);
773     fprintf (config.map_file, ")");
774     break;
775   case etree_binary:
776     fprintf(config.map_file,"(");
777     exp_print_tree(tree->binary.lhs);
778     exp_print_token(tree->type.node_code);
779     exp_print_tree(tree->binary.rhs);
780     fprintf(config.map_file,")");
781     break;
782   case etree_trinary:
783     exp_print_tree(tree->trinary.cond);
784     fprintf(config.map_file,"?");
785     exp_print_tree(tree->trinary.lhs);
786     fprintf(config.map_file,":");
787     exp_print_tree(tree->trinary.rhs);
788     break;
789   case etree_unary:
790     exp_print_token(tree->unary.type.node_code);
791     if (tree->unary.child) 
792     {
793       
794     fprintf(config.map_file,"(");
795     exp_print_tree(tree->unary.child);
796     fprintf(config.map_file,")");
797   }
798     
799     break;
800   case etree_undef:
801     fprintf(config.map_file,"????????");
802     break;
803   case etree_name:
804     if (tree->type.node_code == NAME) {
805       fprintf(config.map_file,"%s", tree->name.name);
806     }
807     else {
808       exp_print_token(tree->type.node_code);
809       if (tree->name.name)
810       fprintf(config.map_file,"(%s)", tree->name.name);
811     }
812     break;
813   default:
814     FAIL();
815     break;
816   }
817 }
818
819
820
821
822 bfd_vma
823 exp_get_vma (tree, def, name, allocation_done)
824      etree_type *tree;
825       bfd_vma def;
826      char *name;
827      lang_phase_type allocation_done;
828 {
829   etree_value_type r;
830
831   if (tree != (etree_type *)NULL) {
832     r = exp_fold_tree_no_dot(tree,
833                  abs_output_section,
834                       allocation_done);
835     if (r.valid == false && name) {
836       einfo("%F%S nonconstant expression for %s\n",name);
837     }
838     return r.value;
839   }
840   else {
841     return def;
842   }
843 }
844
845 int 
846 exp_get_value_int (tree,def,name, allocation_done)
847      etree_type *tree;
848      int def;
849      char *name;
850      lang_phase_type allocation_done;
851 {
852   return (int)exp_get_vma(tree,(bfd_vma)def,name, allocation_done);
853 }
854
This page took 0.073133 seconds and 4 git commands to generate.