diff --git a/1002-elfutils-add-sw.patch b/1000-elfutils-add-sw.patch similarity index 95% rename from 1002-elfutils-add-sw.patch rename to 1000-elfutils-add-sw.patch index 9c4a6f113d4e71ab6d1ae046803f6b549e286a36..86f6d5cb72eda4d1beb744ddefefc748a81c6aaf 100644 --- a/1002-elfutils-add-sw.patch +++ b/1000-elfutils-add-sw.patch @@ -1,13 +1,13 @@ -From 76ea35c712ed2d4c332c86d2c1af2e4c22ae835d Mon Sep 17 00:00:00 2001 +From d40cf1442c60c7290f49502171fccd5396fac87d Mon Sep 17 00:00:00 2001 From: Weisson -Date: Wed, 20 Mar 2024 14:40:50 +0800 -Subject: [PATCH] add sw +Date: Fri, 1 Nov 2024 20:13:28 +0800 +Subject: [PATCH] add sw. Signed-off-by: wxiat Signed-off-by: Weisson --- backends/Makefile.am | 7 +- - backends/Makefile.in | 33 +++++- + backends/Makefile.in | 34 +++++- backends/sw_64_auxv.c | 49 ++++++++ backends/sw_64_corenote.c | 70 +++++++++++ backends/sw_64_init.c | 63 ++++++++++ @@ -25,7 +25,7 @@ Signed-off-by: Weisson src/elflint.c | 2 +- src/findtextrel.c | 2 +- tests/saridx.c | 1 + - 19 files changed, 847 insertions(+), 13 deletions(-) + 19 files changed, 848 insertions(+), 13 deletions(-) create mode 100644 backends/sw_64_auxv.c create mode 100644 backends/sw_64_corenote.c create mode 100644 backends/sw_64_init.c @@ -35,7 +35,7 @@ Signed-off-by: Weisson create mode 100644 backends/sw_64_symbol.c diff --git a/backends/Makefile.am b/backends/Makefile.am -index f373e5f..3076bd2 100644 +index bbb2aac..9591ec6 100644 --- a/backends/Makefile.am +++ b/backends/Makefile.am @@ -37,7 +37,7 @@ AM_CPPFLAGS += -I$(top_srcdir)/libebl -I$(top_srcdir)/libasm \ @@ -57,7 +57,7 @@ index f373e5f..3076bd2 100644 alpha_SRCS = alpha_init.c alpha_symbol.c alpha_retval.c alpha_regs.c \ alpha_corenote.c alpha_auxv.c -@@ -101,7 +104,7 @@ loongarch_SRCS = loongarch_init.c loongarch_symbol.c +@@ -103,7 +106,7 @@ loongarch_SRCS = loongarch_init.c loongarch_symbol.c loongarch_cfi.c \ arc_SRCS = arc_init.c arc_symbol.c libebl_backends_a_SOURCES = $(i386_SRCS) $(sh_SRCS) $(x86_64_SRCS) \ @@ -67,27 +67,28 @@ index f373e5f..3076bd2 100644 $(ppc64_SRCS) $(s390_SRCS) \ $(m68k_SRCS) $(bpf_SRCS) $(riscv_SRCS) $(csky_SRCS) \ diff --git a/backends/Makefile.in b/backends/Makefile.in -index ed5d4ae..0b26f56 100644 +index a7d0889..551c9eb 100644 --- a/backends/Makefile.in +++ b/backends/Makefile.in -@@ -172,12 +172,15 @@ am__objects_15 = csky_attrs.$(OBJEXT) csky_init.$(OBJEXT) \ - csky_initreg.$(OBJEXT) csky_corenote.$(OBJEXT) - am__objects_16 = loongarch_init.$(OBJEXT) loongarch_symbol.$(OBJEXT) +@@ -175,12 +175,16 @@ am__objects_16 = loongarch_init.$(OBJEXT) loongarch_symbol.$(OBJEXT) \ + loongarch_retval.$(OBJEXT) loongarch_initreg.$(OBJEXT) \ + loongarch_unwind.$(OBJEXT) loongarch_corenote.$(OBJEXT) am__objects_17 = arc_init.$(OBJEXT) arc_symbol.$(OBJEXT) +am__objects_18 = sw_64_init.$(OBJEXT) sw_64_symbol.$(OBJEXT) \ -+ sw_64_retval.$(OBJEXT) sw_64_regs.$(OBJEXT) \ -+ sw_64_corenote.$(OBJEXT) sw_64_auxv.$(OBJEXT) ++ sw_64_retval.$(OBJEXT) sw_64_regs.$(OBJEXT) \ ++ sw_64_corenote.$(OBJEXT) sw_64_auxv.$(OBJEXT) am_libebl_backends_a_OBJECTS = $(am__objects_1) $(am__objects_2) \ $(am__objects_3) $(am__objects_4) $(am__objects_5) \ $(am__objects_6) $(am__objects_7) $(am__objects_8) \ $(am__objects_9) $(am__objects_10) $(am__objects_11) \ $(am__objects_12) $(am__objects_13) $(am__objects_14) \ - $(am__objects_15) $(am__objects_16) $(am__objects_17) -+ $(am__objects_15) $(am__objects_16) $(am__objects_17) $(am__objects_18) ++ $(am__objects_15) $(am__objects_16) $(am__objects_17) \ ++ $(am__objects_18) libebl_backends_a_OBJECTS = $(am_libebl_backends_a_OBJECTS) libebl_backends_pic_a_AR = $(AR) $(ARFLAGS) libebl_backends_pic_a_LIBADD = -@@ -205,6 +208,10 @@ am__depfiles_remade = ./$(DEPDIR)/aarch64_cfi.Po \ +@@ -208,6 +212,10 @@ am__depfiles_remade = ./$(DEPDIR)/aarch64_cfi.Po \ ./$(DEPDIR)/alpha_corenote.Po ./$(DEPDIR)/alpha_init.Po \ ./$(DEPDIR)/alpha_regs.Po ./$(DEPDIR)/alpha_retval.Po \ ./$(DEPDIR)/alpha_symbol.Po ./$(DEPDIR)/arc_init.Po \ @@ -98,7 +99,7 @@ index ed5d4ae..0b26f56 100644 ./$(DEPDIR)/arc_symbol.Po ./$(DEPDIR)/arm_attrs.Po \ ./$(DEPDIR)/arm_auxv.Po ./$(DEPDIR)/arm_cfi.Po \ ./$(DEPDIR)/arm_corenote.Po ./$(DEPDIR)/arm_init.Po \ -@@ -530,7 +537,7 @@ textrel_msg = echo "WARNING: TEXTREL found in '$@'" +@@ -538,7 +546,7 @@ textrel_msg = echo "WARNING: TEXTREL found in '$@'" textrel_check = if $(READELF) -d $@ | grep -F -q TEXTREL; then $(textrel_found); fi noinst_LIBRARIES = libebl_backends.a libebl_backends_pic.a modules = i386 sh x86_64 ia64 alpha arm aarch64 sparc ppc ppc64 s390 \ @@ -107,7 +108,7 @@ index ed5d4ae..0b26f56 100644 i386_SRCS = i386_init.c i386_symbol.c i386_corenote.c i386_cfi.c \ i386_retval.c i386_regs.c i386_auxv.c \ -@@ -542,6 +549,8 @@ x86_64_SRCS = x86_64_init.c x86_64_symbol.c x86_64_corenote.c x86_64_cfi.c \ +@@ -550,6 +558,8 @@ x86_64_SRCS = x86_64_init.c x86_64_symbol.c x86_64_corenote.c x86_64_cfi.c \ x86_64_unwind.c x32_corenote.c ia64_SRCS = ia64_init.c ia64_symbol.c ia64_regs.c ia64_retval.c @@ -116,16 +117,16 @@ index ed5d4ae..0b26f56 100644 alpha_SRCS = alpha_init.c alpha_symbol.c alpha_retval.c alpha_regs.c \ alpha_corenote.c alpha_auxv.c -@@ -588,7 +597,7 @@ csky_SRCS = csky_attrs.c csky_init.c csky_symbol.c csky_cfi.c \ - loongarch_SRCS = loongarch_init.c loongarch_symbol.c - arc_SRCS = arc_init.c arc_symbol.c - libebl_backends_a_SOURCES = $(i386_SRCS) $(sh_SRCS) $(x86_64_SRCS) \ -- $(ia64_SRCS) $(alpha_SRCS) $(arm_SRCS) \ -+ $(ia64_SRCS) $(alpha_SRCS) $(sw_64_SRCS) $(arm_SRCS) \ +@@ -603,7 +613,7 @@ libebl_backends_a_SOURCES = $(i386_SRCS) $(sh_SRCS) $(x86_64_SRCS) \ $(aarch64_SRCS) $(sparc_SRCS) $(ppc_SRCS) \ $(ppc64_SRCS) $(s390_SRCS) \ $(m68k_SRCS) $(bpf_SRCS) $(riscv_SRCS) $(csky_SRCS) \ -@@ -661,6 +670,12 @@ distclean-compile: +- $(loongarch_SRCS) $(arc_SRCS) ++ $(loongarch_SRCS) $(arc_SRCS) $(sw_64_SRCS) + + libebl_backends_pic_a_SOURCES = + am_libebl_backends_pic_a_OBJECTS = $(libebl_backends_a_SOURCES:.c=.os) +@@ -672,6 +682,12 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aarch64_retval.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aarch64_symbol.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aarch64_unwind.Po@am__quote@ # am--include-marker @@ -138,7 +139,7 @@ index ed5d4ae..0b26f56 100644 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alpha_auxv.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alpha_corenote.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alpha_init.Po@am__quote@ # am--include-marker -@@ -928,6 +943,12 @@ distclean: distclean-am +@@ -944,6 +960,12 @@ distclean: distclean-am -rm -f ./$(DEPDIR)/alpha_regs.Po -rm -f ./$(DEPDIR)/alpha_retval.Po -rm -f ./$(DEPDIR)/alpha_symbol.Po @@ -151,7 +152,7 @@ index ed5d4ae..0b26f56 100644 -rm -f ./$(DEPDIR)/arc_init.Po -rm -f ./$(DEPDIR)/arc_symbol.Po -rm -f ./$(DEPDIR)/arm_attrs.Po -@@ -1087,6 +1108,12 @@ maintainer-clean: maintainer-clean-am +@@ -1109,6 +1131,12 @@ maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/alpha_regs.Po -rm -f ./$(DEPDIR)/alpha_retval.Po -rm -f ./$(DEPDIR)/alpha_symbol.Po @@ -922,10 +923,10 @@ index 0000000..0fd1ca0 + && (st_other &~ STO_SW_64_STD_GPLOAD) == 0); +} diff --git a/configure b/configure -index 6bcffc7..b299c06 100755 +index 4a3e0a4..c5a4ee7 100755 --- a/configure +++ b/configure -@@ -9413,7 +9413,7 @@ else +@@ -10106,7 +10106,7 @@ else $as_nop case "$gl_cv_host_cpu_c_abi" in i386 | x86_64-x32 | arm | armhf | arm64-ilp32 | hppa | ia64-ilp32 | mips | mipsn32 | powerpc | riscv*-ilp32* | s390 | sparc) gl_cv_host_cpu_c_abi_32bit=yes ;; @@ -934,7 +935,7 @@ index 6bcffc7..b299c06 100755 gl_cv_host_cpu_c_abi_32bit=no ;; *) gl_cv_host_cpu_c_abi_32bit=unknown ;; -@@ -9442,7 +9442,7 @@ else +@@ -10135,7 +10135,7 @@ else $as_nop ;; # CPUs that only support a 64-bit ABI. @@ -990,7 +991,7 @@ index 6e005fa..1522976 100644 && (Ehdr)->e_ident[EI_CLASS] == ELFCLASS64) ? 8 : 4) diff --git a/libelf/elf.h b/libelf/elf.h -index da41bad..234ee7e 100644 +index 7b4a8fe..2ab6c94 100644 --- a/libelf/elf.h +++ b/libelf/elf.h @@ -371,6 +371,7 @@ typedef struct @@ -1001,7 +1002,7 @@ index da41bad..234ee7e 100644 /* Legal values for e_version (version). */ -@@ -2423,6 +2424,80 @@ enum +@@ -2532,6 +2533,80 @@ enum #define DT_ALPHA_PLTRO (DT_LOPROC + 0) #define DT_ALPHA_NUM 1 @@ -1128,10 +1129,10 @@ index b922324..87ed987 100644 changequote([,])dnl gl_cv_host_cpu_c_abi_32bit=no diff --git a/src/Makefile.in b/src/Makefile.in -index a0ab533..741d5f3 100644 +index 5caaf93..9c243b7 100644 --- a/src/Makefile.in +++ b/src/Makefile.in -@@ -486,7 +486,7 @@ ARFLAGS = cr +@@ -510,7 +510,7 @@ ARFLAGS = cr @HAVE_DUPLICATED_COND_WARNING_FALSE@DUPLICATED_COND_WARNING = @HAVE_DUPLICATED_COND_WARNING_TRUE@DUPLICATED_COND_WARNING = -Wduplicated-cond @HAVE_NULL_DEREFERENCE_WARNING_FALSE@NULL_DEREFERENCE_WARNING = @@ -1141,10 +1142,10 @@ index a0ab533..741d5f3 100644 # Use strict fallthrough. Only __attribute__((fallthrough)) will prevent the diff --git a/src/elflint.c b/src/elflint.c -index dd42dcb..60a962b 100644 +index 864de71..53aa8d8 100644 --- a/src/elflint.c +++ b/src/elflint.c -@@ -328,7 +328,7 @@ static const int valid_e_machine[] = +@@ -329,7 +329,7 @@ static const int valid_e_machine[] = EM_68HC16, EM_68HC11, EM_68HC08, EM_68HC05, EM_SVX, EM_ST19, EM_VAX, EM_CRIS, EM_JAVELIN, EM_FIREPATH, EM_ZSP, EM_MMIX, EM_HUANY, EM_PRISM, EM_AVR, EM_FR30, EM_D10V, EM_D30V, EM_V850, EM_M32R, EM_MN10300, diff --git a/elfutils.spec b/elfutils.spec index bf7c0abae83ed21312696cdfc54404a9339a9c93..6d4a7b9ead9a03fe7e5ae1b76a41953d43ff6efc 100644 --- a/elfutils.spec +++ b/elfutils.spec @@ -1,4 +1,4 @@ -%define anolis_release .0.1 +%define anolis_release .0.2 Name: elfutils Version: 0.190 %global baserelease 2 @@ -70,9 +70,7 @@ BuildRequires: gettext-devel # RHEL-18913: Fix handling of corefiles with non-contiguous segments. Patch1: elfutils-0.190-fix-core-noncontig.patch -%ifarch sw_64 -Patch1002: 1002-elfutils-add-sw.patch -%endif +Patch1000: 1000-elfutils-add-sw.patch %description Elfutils is a collection of utilities, including stack (to show @@ -465,6 +463,9 @@ exit 0 %systemd_postun_with_restart debuginfod.service %changelog +* Tue Jul 09 2024 wxiat - 0.190-2.0.2 +- merge sw_64 into Anolis 8 branch. + * Tue Jul 09 2024 wxiat - 0.190-2.0.1 - cherry-pick `add sw patch #3c205be5d4c11327a1b7948458466a3fa4a685ec`. - Exclude loongarch64