Skip to content

Commit

Permalink
8336849: Remove .llvm_addrsig section from JDK/VM static libraries (.…
Browse files Browse the repository at this point in the history
…a files)
  • Loading branch information
jianglizhou committed Jul 20, 2024
1 parent 21a6cf8 commit bc427ba
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions make/common/native/Link.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,11 @@ define CreateStaticLibrary
$(if $$($1_LINK_OBJS_RELATIVE), $$(CD) $$(OUTPUTDIR) ; ) \
$$($1_LD) $(LDFLAGS_CXX_PARTIAL_LINKING) $$($1_SYSROOT_LDFLAGS) \
-o $$($1_TARGET_RELOCATABLE) $$($1_LD_OBJ_ARG))
# Linking with '-Wl,--icf=safe' using objects created by 'ld -r' may not work
# and could cause errors like the following:
# ld: --icf=safe conservatively ignores SHT_LLVM_ADDRSIG [...] with sh_link=0 (likely created using objcopy or ld -r)
$$(call ExecuteWithLog, $$($1_OBJECT_DIR)/$$($1_SAFE_NAME)_objcopy_remove_llvm_addrsig_section, \
$$($1_OBJCOPY) --remove-section=.llvm_addrsig $$($1_TARGET_RELOCATABLE))
endif
$$(call ExecuteWithLog, $$($1_OBJECT_DIR)/$$($1_SAFE_NAME)_run_ar, \
$(if $$($1_LINK_OBJS_RELATIVE), $$(CD) $$(OUTPUTDIR) ; ) \
Expand Down

0 comments on commit bc427ba

Please sign in to comment.