@@ -3173,7 +3173,9 @@ str2uint64(const char *buf, uint64 *p_res)
3173
3173
return true;
3174
3174
}
3175
3175
3176
- #define R_X86_64_GOTPCREL 9 /* 32 bit signed PC relative offset to GOT */
3176
+ #define R_X86_64_GOTPCREL 9 /* 32 bit signed PC relative offset to GOT */
3177
+ #define R_X86_64_GOTPCRELX 41 /* relaxable GOTPCREL */
3178
+ #define R_X86_64_REX_GOTPCRELX 42 /* relaxable GOTPCREL with REX prefix */
3177
3179
3178
3180
static bool
3179
3181
is_text_section (const char * section_name )
@@ -3236,7 +3238,9 @@ do_text_relocation(AOTModule *module, AOTRelocationGroup *group,
3236
3238
}
3237
3239
#if (defined(BUILD_TARGET_X86_64 ) || defined(BUILD_TARGET_AMD_64 )) \
3238
3240
&& !defined(BH_PLATFORM_WINDOWS )
3239
- if (relocation -> relocation_type == R_X86_64_GOTPCREL ) {
3241
+ if (relocation -> relocation_type == R_X86_64_GOTPCREL
3242
+ || relocation -> relocation_type == R_X86_64_GOTPCRELX
3243
+ || relocation -> relocation_type == R_X86_64_REX_GOTPCRELX ) {
3240
3244
GOTItem * got_item = module -> got_item_list ;
3241
3245
uint32 got_item_idx = 0 ;
3242
3246
@@ -3743,7 +3747,9 @@ load_relocation_section(const uint8 *buf, const uint8 *buf_end,
3743
3747
bh_memcpy_s (symbol_name_buf , (uint32 )sizeof (symbol_name_buf ),
3744
3748
symbol_name , symbol_name_len );
3745
3749
3746
- if (relocation .relocation_type == R_X86_64_GOTPCREL
3750
+ if ((relocation .relocation_type == R_X86_64_GOTPCREL
3751
+ || relocation .relocation_type == R_X86_64_GOTPCRELX
3752
+ || relocation .relocation_type == R_X86_64_REX_GOTPCRELX )
3747
3753
&& !strncmp (symbol_name_buf , AOT_FUNC_PREFIX ,
3748
3754
strlen (AOT_FUNC_PREFIX ))) {
3749
3755
uint32 func_idx =
0 commit comments