2 Copyright (C) 1991 Free Software Foundation, Inc.
3 Written by Steve Chamberlain of Cygnus Support.
5 This file is part of GLD, the GNU linker.
7 This program 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 of the License, or
10 (at your option) any later version.
12 This program 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.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
27 /* we keep all the warning symbols in a list, if we ever get a
28 warning, we'll search it the hard way. This won't be to bad since
29 warnings are infrequent, and never that many (true or false ?).
33 typedef struct warning_list_struct
{
34 struct warning_list_struct
*next
;
39 static warning_list_type
*warning_list
;
43 /* This is a warning symbol, add the error text to a list we keep, and mark
44 the symbol referenced as requiring a warning */
51 CONST
char *name
= ((asymbol
*)(sym
->value
))->name
;
52 warning_list_type
*new;
54 ldsym_type
*lookup
= ldsym_get(name
);
56 lookup
->flags
|= SYM_WARNING
;
58 new = (warning_list_type
*)ldmalloc(sizeof(warning_list_type
));
59 new->next
= warning_list
;
64 /* run through the list we kept, and find the warning associated with
70 warning_list_type
*ptr
= warning_list
;
71 while (ptr
!= (warning_list_type
*)NULL
) {
72 if (strcmp(((asymbol
*)(ptr
->sym
->value
))->name
, sym
->name
) == 0) {
73 return ptr
->sym
->name
;
77 return "This is a warning without a message !";
82 produce_warnings (lgs
, it
)
87 ptr
= lgs
->srefs_chain
;
88 while (ptr
!= (asymbol
**)NULL
) {
90 info("%B: %s\n", bfd_asymbol_bfd(ref
), fetch_warning(it
));
91 ptr
= (asymbol
**)(ref
->udata
);
This page took 0.030702 seconds and 4 git commands to generate.