Skip to content

Commit

Permalink
Refactor changes for excluding GOT
Browse files Browse the repository at this point in the history
Add a workaround for __main reference in mingw
  • Loading branch information
eukarpov committed Jul 30, 2024
1 parent b20dbe2 commit b20dcad
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion gcc/config/aarch64/aarch64.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20870,6 +20870,9 @@ aarch64_tlsdesc_abi_id ()
static bool
aarch64_symbol_binds_local_p (const_rtx x)
{
if (TARGET_PECOFF)
return true;

return (SYMBOL_REF_DECL (x)
? targetm.binds_local_p (SYMBOL_REF_DECL (x))
: SYMBOL_REF_LOCAL_P (x));
Expand Down Expand Up @@ -20997,7 +21000,7 @@ aarch64_classify_symbol (rtx x, HOST_WIDE_INT offset)
if ((flag_pic || SYMBOL_REF_WEAK (x))
&& !aarch64_symbol_binds_local_p (x))
return aarch64_cmodel == AARCH64_CMODEL_SMALL_SPIC
? SYMBOL_SMALL_ABSOLUTE : SYMBOL_SMALL_ABSOLUTE;
? SYMBOL_SMALL_GOT_28K : SYMBOL_SMALL_GOT_4G;

/* Same reasoning as the tiny code model, but the offset cap here is
1MB, allowing +/-3.9GB for the offset to the symbol. */
Expand Down
2 changes: 1 addition & 1 deletion gcc/config/aarch64/cygming.h
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ do { \

#undef ASM_DECLARE_FUNCTION_NAME
#define ASM_DECLARE_FUNCTION_NAME(STR, NAME, DECL) \
mingw_pe_declare_function_type (STR, NAME, TREE_PUBLIC (DECL)); \
mingw_pe_declare_function_type (STR, NAME, !strcmp((NAME), "__main") || TREE_PUBLIC (DECL)); \
aarch64_declare_function_name (STR, NAME, DECL)


Expand Down

0 comments on commit b20dcad

Please sign in to comment.