Commit b8c4470
committed
Do not error on undef extern linker symbols
goto-cc currently parses the linker script given by the -T flag to find
addresses for variables that are extern-declared in C files but not
given a definition. This is because some variables are defined in the
linker script, not in C code, and reading these definitions from the
linker script is necessary to verify the C program.
Prior to this commit, goto-cc would error out if some extern-defined
variables remained undefined even after reading the linker script. There
is actually a valid use case for having undefined symbols even after
linking, see this (search for "Undefined symbol to cause link failure"):
https://lore.kernel.org/all/5548CC6D.1040708@citrix.com/T/
This commit turns the error into a warning and synthesizes a null
pointer for such symbols.1 parent 9f894ae commit b8c4470
2 files changed
+7
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
728 | 728 | | |
729 | 729 | | |
730 | 730 | | |
731 | | - | |
| 731 | + | |
732 | 732 | | |
733 | 733 | | |
734 | 734 | | |
735 | 735 | | |
736 | 736 | | |
737 | | - | |
738 | | - | |
| 737 | + | |
739 | 738 | | |
740 | 739 | | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
741 | 744 | | |
742 | 745 | | |
743 | 746 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
198 | 198 | | |
199 | 199 | | |
200 | 200 | | |
201 | | - | |
| 201 | + | |
202 | 202 | | |
203 | 203 | | |
204 | 204 | | |
| |||
0 commit comments