@@ -3173,7 +3173,9 @@ str2uint64(const char *buf, uint64 *p_res)
31733173 return true;
31743174}
31753175
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 */
31773179
31783180static bool
31793181is_text_section (const char * section_name )
@@ -3236,7 +3238,9 @@ do_text_relocation(AOTModule *module, AOTRelocationGroup *group,
32363238 }
32373239#if (defined(BUILD_TARGET_X86_64 ) || defined(BUILD_TARGET_AMD_64 )) \
32383240 && !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 ) {
32403244 GOTItem * got_item = module -> got_item_list ;
32413245 uint32 got_item_idx = 0 ;
32423246
@@ -3743,7 +3747,9 @@ load_relocation_section(const uint8 *buf, const uint8 *buf_end,
37433747 bh_memcpy_s (symbol_name_buf , (uint32 )sizeof (symbol_name_buf ),
37443748 symbol_name , symbol_name_len );
37453749
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 )
37473753 && !strncmp (symbol_name_buf , AOT_FUNC_PREFIX ,
37483754 strlen (AOT_FUNC_PREFIX ))) {
37493755 uint32 func_idx =
0 commit comments