diff options
author | shebs <shebs@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-08-02 01:40:01 +0000 |
---|---|---|
committer | shebs <shebs@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-08-02 01:40:01 +0000 |
commit | e479d0de1ac3023782e07acd68856a24a10f8df8 (patch) | |
tree | 79781eb2cf77e53ee3795a0bf77e941274995a5f /gcc/config/darwin.c | |
parent | 4aa1f91ca0a523e374516456a8d0f69ddfb9fa25 (diff) | |
download | gcc-e479d0de1ac3023782e07acd68856a24a10f8df8.tar.gz |
* config/darwin.c (machopic_stub_name): Try matching by name.
(update_stubs): New function.
(darwin_encode_section_info): Call it and update_non_lazy_ptrs
unconditionally.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@44562 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/darwin.c')
-rw-r--r-- | gcc/config/darwin.c | 41 |
1 files changed, 38 insertions, 3 deletions
diff --git a/gcc/config/darwin.c b/gcc/config/darwin.c index abfb5f763b2..65311a3a615 100644 --- a/gcc/config/darwin.c +++ b/gcc/config/darwin.c @@ -45,6 +45,7 @@ extern void machopic_output_stub PARAMS ((FILE *, const char *, const char *)); static int machopic_data_defined_p PARAMS ((const char *)); static int func_name_maybe_scoped PARAMS ((const char *)); static void update_non_lazy_ptrs PARAMS ((const char *)); +static void update_stubs PARAMS ((const char *)); int name_needs_quotes (name) @@ -330,6 +331,8 @@ machopic_stub_name (name) { if (ident == TREE_VALUE (temp)) return IDENTIFIER_POINTER (TREE_PURPOSE (temp)); + if (strcmp (name, IDENTIFIER_POINTER (TREE_VALUE (temp))) == 0) + return IDENTIFIER_POINTER (TREE_PURPOSE (temp)); } STRIP_NAME_ENCODING (name, name); @@ -1025,9 +1028,6 @@ darwin_encode_section_info (decl) memcpy (new_str, orig_str, len); new_str[1] = code; XSTR (sym_ref, 0) = ggc_alloc_string (new_str, len); - /* The non-lazy pointer list may have captured references to the - old encoded name, change them. */ - update_non_lazy_ptrs (XSTR (sym_ref, 0)); } else { @@ -1041,6 +1041,10 @@ darwin_encode_section_info (decl) memcpy (new_str + 4, orig_str, len); XSTR (sym_ref, 0) = ggc_alloc_string (new_str, new_len); } + /* The non-lazy pointer list may have captured references to the + old encoded name, change them. */ + update_non_lazy_ptrs (XSTR (sym_ref, 0)); + update_stubs (XSTR (sym_ref, 0)); } /* Scan the list of non-lazy pointers and update any recorded names whose @@ -1072,3 +1076,34 @@ update_non_lazy_ptrs (name) } } } + + +/* Scan the list of stubs and update any recorded names whose + stripped name matches the argument. */ + +static void +update_stubs (name) + const char *name; +{ + char *name1, *name2; + tree temp; + + STRIP_NAME_ENCODING (name1, name); + + for (temp = machopic_stubs; + temp != NULL_TREE; + temp = TREE_CHAIN (temp)) + { + char *sym_name = IDENTIFIER_POINTER (TREE_VALUE (temp)); + + if (*sym_name == '!') + { + STRIP_NAME_ENCODING (name2, sym_name); + if (strcmp (name1, name2) == 0) + { + IDENTIFIER_POINTER (TREE_VALUE (temp)) = name; + break; + } + } + } +} |