diff options
| author | mmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-10-22 15:44:44 +0000 |
|---|---|---|
| committer | mmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-10-22 15:44:44 +0000 |
| commit | 16c8d9c898afbd55d2c8656944e1607af2e7fc9b (patch) | |
| tree | 1a6dbe5bea06865aae3d1b5d46785e906be278b6 | |
| parent | 8fd5726c03d12f8d7ad4c4fe898ef5f71ca20d50 (diff) | |
| download | ppe42-gcc-16c8d9c898afbd55d2c8656944e1607af2e7fc9b.tar.gz ppe42-gcc-16c8d9c898afbd55d2c8656944e1607af2e7fc9b.zip | |
* c-pch.c (struct c_pch_validity): Add pch_init field.
(pch_init): Set it.
(c_common_valid_pch): Check it.
(get_ident): Bump the PCH version number.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@72804 138bc75d-0d04-0410-961f-82ee72b054a4
| -rw-r--r-- | gcc/ChangeLog | 7 | ||||
| -rw-r--r-- | gcc/c-pch.c | 14 |
2 files changed, 21 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a6f80eae810..580c3d01da1 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2003-10-22 Mark Mitchell <mark@codesourcery.com> + + * c-pch.c (struct c_pch_validity): Add pch_init field. + (pch_init): Set it. + (c_common_valid_pch): Check it. + (get_ident): Bump the PCH version number. + 2003-10-22 David Taylor <dtaylor@emc.com> PR debug/12500 diff --git a/gcc/c-pch.c b/gcc/c-pch.c index 7fea10c5fe3..f7830b2ba27 100644 --- a/gcc/c-pch.c +++ b/gcc/c-pch.c @@ -48,6 +48,7 @@ struct c_pch_validity unsigned char target_machine_length; unsigned char version_length; unsigned char debug_info_type; + void (*pch_init) (void); }; struct c_pch_header @@ -113,6 +114,7 @@ pch_init (void) v.version_length = strlen (version_string); v.debug_info_type = write_symbols; + v.pch_init = &pch_init; if (fwrite (get_ident(), IDENT_LENGTH, 1, f) != 1 || fwrite (&v, sizeof (v), 1, f) != 1 || fwrite (host_machine, v.host_machine_length, 1, f) != 1 @@ -285,6 +287,18 @@ c_common_valid_pch (cpp_reader *pfile, const char *name, int fd) return 2; } + /* If the text segment was not loaded at the same address as it was + when the PCH file was created, function pointers loaded from the + PCH will not be valid. We could in theory remap all the function + pointers, but no support for that exists at present. */ + if (v.pch_init != &pch_init) + { + if (cpp_get_options (pfile)->warn_invalid_pch) + cpp_error (pfile, DL_WARNING, + "%s: had text segment at different address", name); + return 2; + } + /* Check the preprocessor macros are the same as when the PCH was generated. */ |

