summaryrefslogtreecommitdiff
path: root/gcc/config/darwin.h
diff options
context:
space:
mode:
authorshebs <shebs@138bc75d-0d04-0410-961f-82ee72b054a4>2001-06-08 02:28:04 +0000
committershebs <shebs@138bc75d-0d04-0410-961f-82ee72b054a4>2001-06-08 02:28:04 +0000
commit8dfaa51bab8013cafd356e6531ff02c112c457f0 (patch)
tree7f34d35e3061d6e92b30a8d6b5f8932a596e7a88 /gcc/config/darwin.h
parent6ac91b4ab4b828fa7d00e6c820d1f802fa103327 (diff)
downloadgcc-8dfaa51bab8013cafd356e6531ff02c112c457f0.tar.gz
* config/darwin.h (ENCODE_SECTION_INFO): Define.
(REDO_SECTION_INFO_P): Ditto. (STRIP_NAME_ENCODING): Ditto. (ASM_DECLARE_OBJECT_NAME): Use ENCODE_SECTION_INFO. (ASM_OUTPUT_ALIGNED_DECL_LOCAL): Ditto. (ASM_OUTPUT_LABELREF): Use STRIP_NAME_ENCODING. (GEN_LAZY_PTR_NAME_FOR_SYMBOL): Ditto. * config/darwin.c: No longer include c-tree.h. (machopic_classify_ident): Rewrite to use symbol encoding. (lookup_name_darwin): Remove. (machopic_non_lazy_ptr_name): Handle encoded symbols. (machopic_stub_name): Use STRIP_NAME_ENCODING. (machopic_validate_stub_or_non_lazy_ptr): Ditto. (machopic_finish): Ditto, remove test of decl. (update_non_lazy_ptrs): New function. (darwin_encode_section_info): New function. * config/darwin-protos.h: Declare it. * config/rs6000/rs6000.c (machopic_output_stub): Use STRIP_NAME_ENCODING. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@42994 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/darwin.h')
-rw-r--r--gcc/config/darwin.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc/config/darwin.h b/gcc/config/darwin.h
index 8415f8f6459..b07678053e5 100644
--- a/gcc/config/darwin.h
+++ b/gcc/config/darwin.h
@@ -234,6 +234,10 @@ do { text_section (); \
&& (!DECL_COMMON (DECL) || !TREE_PUBLIC (DECL))) \
|| DECL_INITIAL (DECL)) \
machopic_define_name (xname); \
+ if ((TREE_STATIC (DECL) \
+ && (!DECL_COMMON (DECL) || !TREE_PUBLIC (DECL))) \
+ || DECL_INITIAL (DECL)) \
+ ENCODE_SECTION_INFO (DECL); \
ASM_OUTPUT_LABEL (FILE, xname); \
} while (0)
@@ -243,6 +247,7 @@ do { text_section (); \
#undef ASM_OUTPUT_LABELREF
#define ASM_OUTPUT_LABELREF(FILE,NAME) \
do { \
+ STRIP_NAME_ENCODING (NAME, NAME); \
if (NAME[0] == '&') \
{ \
int len = strlen (NAME); \
@@ -283,6 +288,10 @@ do { text_section (); \
if ((DECL) && ((TREE_STATIC (DECL) \
&& (!DECL_COMMON (DECL) || !TREE_PUBLIC (DECL))) \
|| DECL_INITIAL (DECL))) \
+ ENCODE_SECTION_INFO (DECL); \
+ if ((DECL) && ((TREE_STATIC (DECL) \
+ && (!DECL_COMMON (DECL) || !TREE_PUBLIC (DECL))) \
+ || DECL_INITIAL (DECL))) \
machopic_define_name (NAME); \
} while (0)
@@ -705,6 +714,16 @@ enum machopic_addr_class {
#define MACHOPIC_JUST_INDIRECT (flag_pic == 1)
#define MACHOPIC_PURE (flag_pic == 2)
+#define ENCODE_SECTION_INFO(DECL) \
+ darwin_encode_section_info (DECL)
+
+/* Be conservative and always redo the encoding. */
+
+#define REDO_SECTION_INFO_P(DECL) (1)
+
+#define STRIP_NAME_ENCODING(VAR,SYMBOL_NAME) \
+ ((VAR) = ((SYMBOL_NAME[0] == '!') ? (SYMBOL_NAME) + 4 : (SYMBOL_NAME)))
+
#define GEN_BINDER_NAME_FOR_STUB(BUF,STUB,STUB_LENGTH) \
do { \
const char *stub_ = (STUB); \
@@ -741,6 +760,7 @@ enum machopic_addr_class {
do { \
const char *symbol_ = (SYMBOL); \
char *buffer_ = (BUF); \
+ STRIP_NAME_ENCODING (symbol_, symbol_); \
if (symbol_[0] == '"') \
{ \
strcpy (buffer_, "\"L"); \