[PATCH v3] Add support for Synopsys ARCv2 processors

2022-12-20 Thread Shahab Vahedi via Elfutils-devel
There is no regression in tests for an x86_64 build, while the new
hello_arc_hs4.ko is added as well.  This is the only meaningful
test that I could add at the moment, given the features supported
by this port.

$ cat tests/test-suite.log
  ==
 elfutils 0.188: tests/test-suite.log
  ==

  # TOTAL: 236
  # PASS:  235
  # SKIP:  1
  # XFAIL: 0
  # FAIL:  0
  # XPASS: 0
  # ERROR: 0

  .. contents:: :depth: 2

  SKIP: run-lfs-symbols.sh
  

  LFS testing is irrelevant on this system
  SKIP run-lfs-symbols.sh (exit status: 77)

$ cat tests/run-strip-reloc.sh.log
  runtest hello_i386.ko
  runtest hello_x86_64.ko
  runtest hello_ppc64.ko
  runtest hello_s390.ko
  runtest hello_aarch64.ko
  runtest hello_m68k.ko
  runtest hello_riscv64.ko
  runtest hello_csky.ko
  runtest hello_arc_hs4.ko<-- [ new ARC HS4 test ]
  runtest /home/shahab/pahole_pkg/elfutils-git/bld_arc/src/strip
  runtest /home/shahab/pahole_pkg/elfutils-git/bld_arc/src/strip.o
  runtest strip-uncompressed.o
  runtest strip-compressed.o
  runtest testfile-debug-rel-ppc64.o
  runtest testfile-debug-rel-ppc64-z.o
  runtest testfile-debug-rel-ppc64-g.o
  PASS run-strip-reloc.sh (exit status: 0)

Signed-off-by: Shahab Vahedi 
---
Chagelog:
v3:
  - Drop libelf/elf.h changes now that they're synced from glibc.
  - Drop src/elflint.c changes as EM_ARC was already in valid_e_machine[].
  - Add test for ARC HS4 in run-strip-reloc.
  - Update ChangLogs and a few more cosemitic changes.
  - Reword the commit message.

v2:
  - Add ChangeLog entries.
  - Reduce number of changes in libelf/elf.h
  - Reword the commit message.

 backends/ChangeLog |   9 
 backends/Makefile.am   |   6 ++-
 backends/arc_init.c|  55 +++
 backends/arc_reloc.def |  87 +
 backends/arc_symbol.c  |  81 ++
 libebl/ChangeLog   |   5 +++
 libebl/eblopenbackend.c|   2 +
 tests/ChangeLog|   6 +++
 tests/Makefile.am  |   1 +
 tests/hello_arc_hs4.ko.bz2 | Bin 0 -> 15004 bytes
 tests/run-strip-reloc.sh   |   4 +-
 11 files changed, 253 insertions(+), 3 deletions(-)
 create mode 100644 backends/arc_init.c
 create mode 100644 backends/arc_reloc.def
 create mode 100644 backends/arc_symbol.c
 create mode 100644 tests/hello_arc_hs4.ko.bz2

diff --git a/backends/ChangeLog b/backends/ChangeLog
index 5813ddcc..8dc792fa 100644
--- a/backends/ChangeLog
+++ b/backends/ChangeLog
@@ -1,3 +1,12 @@
+2022-12-20  Shahab Vahedi  
+
+   * Makefile.am (modules): Add arc.
+   (arc_SRCS): Added.
+   (libebl_backends_a_SOURCES): Append arc_SRCS.
+   * arc_init.c: New file.
+   * arc_reloc.def: New file.
+   * arc_symbol.c: New file.
+
 2022-12-02  Hengqi Chen  
 
* Makefile.am (modules): Add loongarch.
diff --git a/backends/Makefile.am b/backends/Makefile.am
index 0824123d..f373e5fb 100644
--- a/backends/Makefile.am
+++ b/backends/Makefile.am
@@ -37,7 +37,7 @@ AM_CPPFLAGS += -I$(top_srcdir)/libebl -I$(top_srcdir)/libasm \
 noinst_LIBRARIES = libebl_backends.a libebl_backends_pic.a
 
 modules = i386 sh x86_64 ia64 alpha arm aarch64 sparc ppc ppc64 s390 \
- m68k bpf riscv csky loongarch
+ m68k bpf riscv csky loongarch arc
 
 i386_SRCS = i386_init.c i386_symbol.c i386_corenote.c i386_cfi.c \
i386_retval.c i386_regs.c i386_auxv.c \
@@ -98,12 +98,14 @@ 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) \
$(aarch64_SRCS) $(sparc_SRCS) $(ppc_SRCS) \
$(ppc64_SRCS) $(s390_SRCS) \
$(m68k_SRCS) $(bpf_SRCS) $(riscv_SRCS) $(csky_SRCS) 
\
-   $(loongarch_SRCS)
+   $(loongarch_SRCS) $(arc_SRCS)
 
 libebl_backends_pic_a_SOURCES =
 am_libebl_backends_pic_a_OBJECTS = $(libebl_backends_a_SOURCES:.c=.os)
diff --git a/backends/arc_init.c b/backends/arc_init.c
new file mode 100644
index ..a013bc4e
--- /dev/null
+++ b/backends/arc_init.c
@@ -0,0 +1,55 @@
+/* Initialization of ARC specific backend library.
+   Copyright (C) 2022 Synopsys Inc.
+   This file is part of elfutils.
+
+   This file is free software; you can redistribute it and/or modify
+   it under the terms of either
+
+ * the GNU Lesser General Public License as published by the Free
+   Software Foundation; either version 3 of the License, or (at
+   your option) any later version
+
+   or
+
+ * the GNU General Public License as published by the Free
+   Software Foundation; either version 2 of the License, or (at
+   your option) any later version

Re: [PATCH 02/25] ignore build directory

2022-12-20 Thread Mark Wielaard
On Sat, 2022-12-17 at 05:14 +0800, 罗勇刚(Yonggang Luo) wrote:
> It's a common step to configure and make under build directory, so
> that the
> IDE won't affect by it

I rather not just ignore a random directory name, unless it clearly is
a default for the build system.


Re: [PATCH 06/25] move platform depended include into system.h of libebl

2022-12-20 Thread Mark Wielaard
Hi,

On Sat, 2022-12-17 at 05:19 +0800, 罗勇刚(Yonggang Luo) wrote:
> On Fri, Oct 28, 2022 at 7:35 PM Mark Wielaard  wrote:
> > 
> > On Fri, 2022-10-21 at 02:25 +0800, Yonggang Luo via Elfutils-devel
> > wrote:
> > > Because all source in libebl #include , so #include
> > >  in
> > > libeblP.h is enough, there is multiple memory-access.h file, so
> > > use
> > > relative path to
> > > include it properly,
> > 
> > I am not a fan of the relative path trick, especially if there it
> > is
> > clear only one is every needed. You also use it for other files,
> > why?
> 
> I am respect the original code
> looks at
> https://github.com/sourceware-org/elfutils/blob/master/libdwfl/core-file.c#L31

I see. But I rather fix that than do the same in new files.

The attached patch does that so no relative paths are needed in
#include statements.

Cheers,

Mark
From 426db34b65d660c439b31d25308bc346d6272923 Mon Sep 17 00:00:00 2001
From: Mark Wielaard 
Date: Tue, 20 Dec 2022 14:53:43 +0100
Subject: [PATCH] Do not use relative include paths in library files.

Rely on include dirs being set up correctly. Setup libdw AM_CPPFLAGS
to include libebl directory. In libdwfl note that debuginfod.h is a
generated file in the builddir. Only include it in the one file
debuginfod-client.c that really needs it.

Signed-off-by: Mark Wielaard 
---
 libasm/ChangeLog |  6 ++
 libasm/disasm_begin.c|  2 +-
 libasm/disasm_cb.c   |  2 +-
 libcpu/ChangeLog |  6 ++
 libcpu/bpf_disasm.c  |  4 ++--
 libcpu/i386_disasm.c |  2 +-
 libcpu/riscv_disasm.c|  2 +-
 libdw/ChangeLog  |  7 +++
 libdw/Makefile.am|  2 +-
 libdw/cfi.c  |  2 +-
 libdw/encoded-value.h|  2 +-
 libdw/frame-cache.c  |  2 +-
 libdwelf/ChangeLog   |  4 
 libdwelf/libdwelfP.h |  2 +-
 libdwfl/ChangeLog| 24 
 libdwfl/Makefile.am  |  2 +-
 libdwfl/core-file.c  |  2 +-
 libdwfl/cu.c |  4 ++--
 libdwfl/debuginfod-client.c  |  2 ++
 libdwfl/dwfl_dwarf_line.c|  2 +-
 libdwfl/dwfl_lineinfo.c  |  2 +-
 libdwfl/dwfl_module.c|  2 +-
 libdwfl/dwfl_module_dwarf_cfi.c  |  2 +-
 libdwfl/dwfl_module_eh_cfi.c |  2 +-
 libdwfl/dwfl_module_getdwarf.c   |  4 ++--
 libdwfl/dwfl_module_getsrc.c |  2 +-
 libdwfl/dwfl_module_getsrc_file.c|  2 +-
 libdwfl/dwfl_segment_report_module.c |  2 +-
 libdwfl/elf-from-memory.c|  2 +-
 libdwfl/frame_unwind.c   |  2 +-
 libdwfl/libdwflP.h   |  8 ++--
 libdwfl/lines.c  |  2 +-
 libdwfl/link_map.c   |  2 +-
 libdwfl/linux-core-attach.c  |  2 +-
 libdwfl/open.c   |  2 +-
 35 files changed, 82 insertions(+), 37 deletions(-)

diff --git a/libasm/ChangeLog b/libasm/ChangeLog
index ce0f24f4..a12d14b3 100644
--- a/libasm/ChangeLog
+++ b/libasm/ChangeLog
@@ -1,3 +1,9 @@
+2022-12-20  Mark Wielaard  
+
+	* disasm_begin.c: Include libeblP.h.
+	* disasm_cb.c: Likewise.
+	* bpf_disasm.c: Likewise and include common.h.
+
 2022-10-21  Yonggang Luo  
 
 	* asm_abort.c: Don't include unistd.h.
diff --git a/libasm/disasm_begin.c b/libasm/disasm_begin.c
index cb10f66e..78db90c7 100644
--- a/libasm/disasm_begin.c
+++ b/libasm/disasm_begin.c
@@ -34,7 +34,7 @@
 #include 
 
 #include "libasmP.h"
-#include "../libebl/libeblP.h"
+#include "libeblP.h"
 
 
 DisasmCtx_t *
diff --git a/libasm/disasm_cb.c b/libasm/disasm_cb.c
index 80f8b25b..9353e2e5 100644
--- a/libasm/disasm_cb.c
+++ b/libasm/disasm_cb.c
@@ -33,7 +33,7 @@
 #include 
 
 #include "libasmP.h"
-#include "../libebl/libeblP.h"
+#include "libeblP.h"
 
 
 struct symtoken
diff --git a/libcpu/ChangeLog b/libcpu/ChangeLog
index 248b1aba..bd517b94 100644
--- a/libcpu/ChangeLog
+++ b/libcpu/ChangeLog
@@ -1,3 +1,9 @@
+2022-12-20  Mark Wielaard  
+
+	* bpf_disasm.c: Include common.h and libeblP.h.
+	* i386_disasm.c: Include libeblP.h.
+	* riscv_disasm.c: Likewise.
+
 2022-10-21  Yonggang Luo  
 
 	* i386_data.h: Define FCT_mod$64r_m as FCT_mod$r_m for i386.
diff --git a/libcpu/bpf_disasm.c b/libcpu/bpf_disasm.c
index 62643c81..dabd8a4e 100644
--- a/libcpu/bpf_disasm.c
+++ b/libcpu/bpf_disasm.c
@@ -37,8 +37,8 @@
 #include 
 #include "bpf.h"
 
-#include "../libelf/common.h"
-#include "../libebl/libeblP.h"
+#include "common.h"
+#include "libeblP.h"
 
 static const char class_string[8][8] = {
   [BPF_LD]= "ld",
diff --git a/libcpu/i386_disasm.c b/libcpu/i386_disasm.c
index 599d1654..c42f8d1c 100644
--- a/libcpu/i386_disasm.c
+++ b/libcpu/i386_disasm.c
@@ -41,7 +41,7 @@
 #include 
 #include 
 
-#include "../libebl/libeblP.h"
+#include "libeblP.h"
 
 #define MACHINE_ENCODING LITTLE_ENDIAN
 #include "memory-access.

Re: [PATCH 08/25] Use configure to detect HAVE_DECL_MMAP and use it for system doesn't provide sys/mman.h

2022-12-20 Thread Mark Wielaard
Hi,

On Sat, 2022-12-17 at 05:21 +0800, 罗勇刚(Yonggang Luo) wrote:
> On Fri, Oct 28, 2022 at 7:41 PM Mark Wielaard  wrote:
> > On Fri, 2022-10-21 at 02:25 +0800, Yonggang Luo via Elfutils-devel
> > wrote:
> > > Signed-off-by: Yonggang Luo 
> > > ---
> > >  configure.ac  | 1 +
> > >  lib/crc32_file.c  | 4 ++--
> > >  lib/system.h  | 2 ++
> > >  libelf/elf32_updatefile.c | 3 ++-
> > >  libelf/elf_begin.c| 5 -
> > >  libelf/elf_end.c  | 2 ++
> > >  libelf/elf_update.c   | 5 -
> > 
> > Missing commit message and ChangeLog entries.
> > 
> > So this is for a system that doesn't have mmap?
> > How does the testsuite results look on such a system?
> > 
> > ELF_C_{READ,WRITE,RDWR}_MMAP[_PRIVATE] are elfutils extensions, but
> > they are used internally in other libraries.
> 
> I am trying getting elf support for windows/mingw/msvc, the  MMAP support
> is not needed yet
> for (QEMU/mesa)

I have to think what it means for a system that doesn't have mmap since
the mmap extensions are part of the public interface. And various parts
of the libraries depend on knowledge that they can read/write directly
from mmapped parts. Does it really make sense to try to support a
platform without mmap?

Cheers,

Mark


Re: [PATCH 09/25] include libgen.h in system.h

2022-12-20 Thread Mark Wielaard
On Sat, 2022-12-17 at 05:22 +0800, 罗勇刚(Yonggang Luo) wrote:
> On Fri, Oct 28, 2022 at 7:45 PM Mark Wielaard  wrote:
> > 
> > On Fri, 2022-10-21 at 02:25 +0800, Yonggang Luo via Elfutils-devel
> > wrote:
> > > basename function are accessed multiple place, but used without
> > > include libgen.h
> > 
> > This is wrong. We use the GNU basename (from string.h with
> > _GNU_SOURCE), not the POSIX one (from libgen.h).
> 
> Thanks, that informs me, are they the same thing?

No, they are subtly different things.
See https://www.man7.org/linux/man-pages/man3/basename.3.html#NOTES
In particular the GNU basename never manipulates its argument (which is
why the cast is wrong).

Cheers,

Mark


Re: [PATCH 14/25] libdw: check __OPTIMIZE__ in dwarf_whatattr.c and dwarf_whatform.c to match the header

2022-12-20 Thread Mark Wielaard
On Sat, 2022-12-17 at 05:47 +0800, 罗勇刚(Yonggang Luo) wrote:
> From bdf8a3b45f063d010e7c93b3d3bfc42b801ee9b2 Mon Sep 17 00:00:00
> 2001
> From: Yonggang Luo 
> Date: Thu, 20 Oct 2022 02:50:03 +0800
> Subject: [PATCH] libdw: Fixes compile of dwarf_whatattr.c and
> dwarf_whatform.c
> 
> If __OPTIMIZE__ is defined, then compile  dwarf_whatattr.c and
> dwarf_whatform.c
> will cause symbol conflict between
> dwarf_whatattr.c and libdw.h,
> dwarf_whatform.c and libdw.h,
> 
> So always undefined __OPTIMIZE__ when compiling these two files

I don't think this is correct either. Some system headers might depend
on __OPTIMIZE__ being defined. Are you using a compiler that doesn't
define __OPTIMIZE__ ?

Cheers,

Mark


Re: [PATCH 15/25] lib: Implement error properly even when not HAVE_ERR_H

2022-12-20 Thread Mark Wielaard
Hi,

On Sat, 2022-12-17 at 05:50 +0800, 罗勇刚(Yonggang Luo) wrote:
> On Mon, Dec 12, 2022 at 11:37 PM Mark Wielaard 
> wrote:
> > On Fri, 2022-10-21 at 02:25 +0800, Yonggang Luo via Elfutils-devel
> > wrote:
> > > on win32, there is no err.h
> > > [...]
> > > +#else
> > > +  (void)status;
> > > +  vfprintf(stderr, format, argp);
> > > +#endif
> > >va_end(argp);
> > 
> > That doesn't look like a valid implementation of error, it ignores
> > errno and doesn't exit when necessary.
> 
> Do you mean it should  call `exit(status)` after the  error message
> is
> printed?

Yes, if status != 0. Also errno should be printed (as a string).

Cheers,

Mark


Re: [PATCH 08/25] Use configure to detect HAVE_DECL_MMAP and use it for system doesn't provide sys/mman.h

2022-12-20 Thread Yonggang Luo
On Tue, Dec 20, 2022 at 10:04 PM Mark Wielaard  wrote:
>
> Hi,
>
> On Sat, 2022-12-17 at 05:21 +0800, 罗勇刚(Yonggang Luo) wrote:
> > On Fri, Oct 28, 2022 at 7:41 PM Mark Wielaard  wrote:
> > > On Fri, 2022-10-21 at 02:25 +0800, Yonggang Luo via Elfutils-devel
> > > wrote:
> > > > Signed-off-by: Yonggang Luo 
> > > > ---
> > > >  configure.ac  | 1 +
> > > >  lib/crc32_file.c  | 4 ++--
> > > >  lib/system.h  | 2 ++
> > > >  libelf/elf32_updatefile.c | 3 ++-
> > > >  libelf/elf_begin.c| 5 -
> > > >  libelf/elf_end.c  | 2 ++
> > > >  libelf/elf_update.c   | 5 -
> > >
> > > Missing commit message and ChangeLog entries.
> > >
> > > So this is for a system that doesn't have mmap?
> > > How does the testsuite results look on such a system?
> > >
> > > ELF_C_{READ,WRITE,RDWR}_MMAP[_PRIVATE] are elfutils extensions, but
> > > they are used internally in other libraries.
> >
> > I am trying getting elf support for windows/mingw/msvc, the  MMAP
support
> > is not needed yet
> > for (QEMU/mesa)
>
> I have to think what it means for a system that doesn't have mmap since
> the mmap extensions are part of the public interface. And various parts
> of the libraries depend on knowledge that they can read/write directly
> from mmapped parts. Does it really make sense to try to support a
> platform without mmap?

Windows have mmap, just didn't have the direct posix mman API


>
> Cheers,
>
> Mark



--
 此致
礼
罗勇刚
Yours
sincerely,
Yonggang Luo


Re: [PATCH 14/25] libdw: check __OPTIMIZE__ in dwarf_whatattr.c and dwarf_whatform.c to match the header

2022-12-20 Thread Yonggang Luo
On Tue, Dec 20, 2022 at 11:08 PM Mark Wielaard  wrote:
>
> On Sat, 2022-12-17 at 05:47 +0800, 罗勇刚(Yonggang Luo) wrote:
> > From bdf8a3b45f063d010e7c93b3d3bfc42b801ee9b2 Mon Sep 17 00:00:00
> > 2001
> > From: Yonggang Luo 
> > Date: Thu, 20 Oct 2022 02:50:03 +0800
> > Subject: [PATCH] libdw: Fixes compile of dwarf_whatattr.c and
> > dwarf_whatform.c
> >
> > If __OPTIMIZE__ is defined, then compile  dwarf_whatattr.c and
> > dwarf_whatform.c
> > will cause symbol conflict between
> > dwarf_whatattr.c and libdw.h,
> > dwarf_whatform.c and libdw.h,
> >
> > So always undefined __OPTIMIZE__ when compiling these two files
>
> I don't think this is correct either. Some system headers might depend
> on __OPTIMIZE__ being defined. Are you using a compiler that doesn't
> define __OPTIMIZE__ ?

In debug mode, __OPTIMIZE__   won't be defined.


>
> Cheers,
>
> Mark



--
 此致
礼
罗勇刚
Yours
sincerely,
Yonggang Luo


Re: [PATCH v3] Add support for Synopsys ARCv2 processors

2022-12-20 Thread Mark Wielaard
Hi Shabab,

On Tue, 2022-12-20 at 12:56 +0100, Shahab Vahedi wrote:
> There is no regression in tests for an x86_64 build, while the new
> hello_arc_hs4.ko is added as well.  This is the only meaningful
> test that I could add at the moment, given the features supported
> by this port.
> 
> $ cat tests/test-suite.log
>   ==
>  elfutils 0.188: tests/test-suite.log
>   ==
> 
>   # TOTAL: 236
>   # PASS:  235
>   # SKIP:  1
>   # XFAIL: 0
>   # FAIL:  0
>   # XPASS: 0
>   # ERROR: 0
> 
>   .. contents:: :depth: 2
> 
>   SKIP: run-lfs-symbols.sh
>   
> 
>   LFS testing is irrelevant on this system
>   SKIP run-lfs-symbols.sh (exit status: 77)
> 
> $ cat tests/run-strip-reloc.sh.log
>   runtest hello_i386.ko
>   runtest hello_x86_64.ko
>   runtest hello_ppc64.ko
>   runtest hello_s390.ko
>   runtest hello_aarch64.ko
>   runtest hello_m68k.ko
>   runtest hello_riscv64.ko
>   runtest hello_csky.ko
>   runtest hello_arc_hs4.ko<-- [ new ARC HS4 test ]
>   runtest /home/shahab/pahole_pkg/elfutils-git/bld_arc/src/strip
>   runtest /home/shahab/pahole_pkg/elfutils-git/bld_arc/src/strip.o
>   runtest strip-uncompressed.o
>   runtest strip-compressed.o
>   runtest testfile-debug-rel-ppc64.o
>   runtest testfile-debug-rel-ppc64-z.o
>   runtest testfile-debug-rel-ppc64-g.o
>   PASS run-strip-reloc.sh (exit status: 0)
> 
> Signed-off-by: Shahab Vahedi 
> ---
> Chagelog:
> v3:
>   - Drop libelf/elf.h changes now that they're synced from glibc.
>   - Drop src/elflint.c changes as EM_ARC was already in
> valid_e_machine[].

It was, but you are (also) providing code for EM_ARCV2 don't you?
So I believe you do want:

diff --git a/src/elflint.c b/src/elflint.c
index b9548862..b4eac32f 100644
--- a/src/elflint.c
+++ b/src/elflint.c
@@ -330,6 +330,7 @@ static const int valid_e_machine[] =
 EM_AVR, EM_FR30, EM_D10V, EM_D30V, EM_V850, EM_M32R, EM_MN10300,
 EM_MN10200, EM_PJ, EM_OPENRISC, EM_ARC_A5, EM_XTENSA, EM_ALPHA,
 EM_TILEGX, EM_TILEPRO, EM_AARCH64, EM_BPF, EM_RISCV, EM_CSKY, EM_LOONGARCH,
+EM_ARCV2
   };
 #define nvalid_e_machine \
   (sizeof (valid_e_machine) / sizeof (valid_e_machine[0]))

>   - Add test for ARC HS4 in run-strip-reloc.
>   - Update ChangLogs and a few more cosemitic changes.
>   - Reword the commit message.
> 
> v2:
>   - Add ChangeLog entries.
>   - Reduce number of changes in libelf/elf.h
>   - Reword the commit message.
> 
>  backends/ChangeLog |   9 
>  backends/Makefile.am   |   6 ++-
>  backends/arc_init.c|  55 +++
>  backends/arc_reloc.def |  87
> +
>  backends/arc_symbol.c  |  81 ++
>  libebl/ChangeLog   |   5 +++
>  libebl/eblopenbackend.c|   2 +
>  tests/ChangeLog|   6 +++
>  tests/Makefile.am  |   1 +
>  tests/hello_arc_hs4.ko.bz2 | Bin 0 -> 15004 bytes
>  tests/run-strip-reloc.sh   |   4 +-
>  11 files changed, 253 insertions(+), 3 deletions(-)
>  create mode 100644 backends/arc_init.c
>  create mode 100644 backends/arc_reloc.def
>  create mode 100644 backends/arc_symbol.c
>  create mode 100644 tests/hello_arc_hs4.ko.bz2
> 
> diff --git a/backends/ChangeLog b/backends/ChangeLog
> index 5813ddcc..8dc792fa 100644
> --- a/backends/ChangeLog
> +++ b/backends/ChangeLog
> @@ -1,3 +1,12 @@
> +2022-12-20  Shahab Vahedi  
> +
> + * Makefile.am (modules): Add arc.
> + (arc_SRCS): Added.
> + (libebl_backends_a_SOURCES): Append arc_SRCS.
> + * arc_init.c: New file.
> + * arc_reloc.def: New file.
> + * arc_symbol.c: New file.
> +
>  2022-12-02  Hengqi Chen  
>  
>   * Makefile.am (modules): Add loongarch.
> diff --git a/backends/Makefile.am b/backends/Makefile.am
> index 0824123d..f373e5fb 100644
> --- a/backends/Makefile.am
> +++ b/backends/Makefile.am
> @@ -37,7 +37,7 @@ AM_CPPFLAGS += -I$(top_srcdir)/libebl
> -I$(top_srcdir)/libasm \
>  noinst_LIBRARIES = libebl_backends.a libebl_backends_pic.a
>  
>  modules = i386 sh x86_64 ia64 alpha arm aarch64 sparc ppc ppc64 s390
> \
> -   m68k bpf riscv csky loongarch
> +   m68k bpf riscv csky loongarch arc
>  
>  i386_SRCS = i386_init.c i386_symbol.c i386_corenote.c i386_cfi.c \
>   i386_retval.c i386_regs.c i386_auxv.c \
> @@ -98,12 +98,14 @@ 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) \
>   $(aarch64_SRCS) $(sparc_SRCS) $(ppc_SRCS) \
>   $(ppc64_SRCS) $(s390_SRCS) \
>   $(m68k_SRCS) $(bpf_SRCS) $(riscv_SRCS)
> $(csky_SRCS) \
> - $(loongarch_SRCS)
> + $(loong

Re: [PATCH 06/25] move platform depended include into system.h of libebl

2022-12-20 Thread Mark Wielaard


On Tue, 2022-12-20 at 14:59 +0100, Mark Wielaard wrote:
> The attached patch does that so no relative paths are needed in
> #include statements.

The try-bot looked good:
https://builder.sourceware.org/buildbot/#/changes/16025

So I pushed this:

commit 6ecd16410ce1fe5cb0ac5b7c3342c5cc330e3a04
Author: Mark Wielaard 
Date:   Tue Dec 20 14:53:43 2022 +0100

Do not use relative include paths in library files.

Rely on include dirs being set up correctly. Setup libdw AM_CPPFLAGS
to include libebl directory. In libdwfl note that debuginfod.h is a
generated file in the builddir. Only include it in the one file
debuginfod-client.c that really needs it.

Signed-off-by: Mark Wielaard 


☺ Buildbot (GNU Toolchain): elfutils - build successful (master)

2022-12-20 Thread builder--- via Elfutils-devel
A restored build has been detected on builder elfutils-debian-arm64 while 
building elfutils.

Full details are available at:
https://builder.sourceware.org/buildbot/#builders/5/builds/112

Build state: build successful
Revision: 6ecd16410ce1fe5cb0ac5b7c3342c5cc330e3a04
Worker: debian-arm64
Build Reason: (unknown)
Blamelist: Hengqi Chen , Mark Wielaard 

Steps:

- 0: worker_preparation ( success )

- 1: set package name ( success )

- 2: git checkout ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/5/builds/112/steps/2/logs/stdio

- 3: autoreconf ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/5/builds/112/steps/3/logs/stdio

- 4: configure ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/5/builds/112/steps/4/logs/stdio

- 5: get version ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/5/builds/112/steps/5/logs/stdio
- property changes: 
https://builder.sourceware.org/buildbot/#builders/5/builds/112/steps/5/logs/property_changes

- 6: make ( warnings )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/5/builds/112/steps/6/logs/stdio
- warnings (3): 
https://builder.sourceware.org/buildbot/#builders/5/builds/112/steps/6/logs/warnings__3_

- 7: make check ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/5/builds/112/steps/7/logs/stdio
- test-suite.log: 
https://builder.sourceware.org/buildbot/#builders/5/builds/112/steps/7/logs/test-suite_log

- 8: prep ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/5/builds/112/steps/8/logs/stdio

- 9: build bunsen.cpio.gz ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/5/builds/112/steps/9/logs/stdio

- 10: fetch bunsen.cpio.gz ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/5/builds/112/steps/10/logs/stdio

- 11: unpack bunsen.cpio.gz ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/5/builds/112/steps/11/logs/stdio

- 12: pass .bunsen.source.gitname ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/5/builds/112/steps/12/logs/stdio

- 13: pass .bunsen.source.gitdescribe ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/5/builds/112/steps/13/logs/stdio

- 14: pass .bunsen.source.gitbranch ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/5/builds/112/steps/14/logs/stdio

- 15: pass .bunsen.source.gitrepo ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/5/builds/112/steps/15/logs/stdio

- 16: upload to bunsen ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/5/builds/112/steps/16/logs/stdio

- 17: clean up ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/5/builds/112/steps/17/logs/stdio

- 18: make distclean ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/5/builds/112/steps/18/logs/stdio

A new failure has been detected on builder elfutils-fedora-ppc64le while 
building elfutils.

Full details are available at:
https://builder.sourceware.org/buildbot/#builders/55/builds/114

Build state: failed test (failure)
Revision: 6ecd16410ce1fe5cb0ac5b7c3342c5cc330e3a04
Worker: fedora-ppc64le
Build Reason: (unknown)
Blamelist: Mark Wielaard 

Steps:

- 0: worker_preparation ( success )

- 1: set package name ( success )

- 2: git checkout ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/55/builds/114/steps/2/logs/stdio

- 3: autoreconf ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/55/builds/114/steps/3/logs/stdio

- 4: configure ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/55/builds/114/steps/4/logs/stdio

- 5: get version ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/55/builds/114/steps/5/logs/stdio
- property changes: 
https://builder.sourceware.org/buildbot/#builders/55/builds/114/steps/5/logs/property_changes

- 6: make ( warnings )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/55/builds/114/steps/6/logs/stdio
- warnings (3): 
https://builder.sourceware.org/buildbot/#builders/55/builds/114/steps/6/logs/warnings__3_

- 7: make check ( failure )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#builders/55/builds/114/steps/7/logs/stdio
- test-suite.log: 
https://builder.sourceware.org/buildbot/#builders/55/builds/114/steps/7/logs/test-suite_log

- 8: prep ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#

Re: [PATCHv2] strip: keep .ctf section in stripped file

2022-12-20 Thread Mark Wielaard
Hi Guillermo,

On Wed, Jun 01, 2022 at 10:55:27AM -0500, Guillermo E. Martinez via 
Elfutils-devel wrote:
> This is the second version patch to avoid remove the CTF section in
> stripped files. Changes from v1:
> 
>   - Add description in tests/run-strip-remove-keep-ctf.sh
> mentioning how to regenerate test input file (testfile-ctf)
> 
> Please let me know your thoughts.
>
> [...]
> 
> CTF debug format was designed to be present in stripped files, so
> this section should not be removed, so a new --remove-ctf option
> is added to indicate explicitly that .ctf section will be stripped
> out from binary file.

Sorry, I see I never reviewed this v2 variant.  I know we tried to
coordinate with binutils so eu-strip and binutils strip would do the
same thing. And that Jose had an idea for a new section flag to
automatically detect what section should/shouldn't be stripped (into a
separate .debug file). What was the conclusion of that?

Thanks,

Mark


[PATCH] lib: Remove -ffunction-sections for xmalloc

2022-12-20 Thread Mark Wielaard
The build used -ffunction-sections just for one file.

Signed-off-by: Mark Wielaard 
---
 lib/ChangeLog   | 4 
 lib/Makefile.am | 4 
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/ChangeLog b/lib/ChangeLog
index 6bb0d4d0..5ab9477e 100644
--- a/lib/ChangeLog
+++ b/lib/ChangeLog
@@ -1,3 +1,7 @@
+2022-12-20  Mark Wielaard  
+
+   * Makefile.am (xmalloc_CFLAGS): Remove.
+
 2022-09-21  Yonggang Luo  
 
* color.c: Don't include unistd.h.
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 42ddf5ae..b3bb929f 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -41,7 +41,3 @@ noinst_HEADERS = fixedsizehash.h libeu.h system.h 
dynamicsizehash.h list.h \
 eu-config.h color.h printversion.h bpf.h \
 atomics.h stdatomic-fbsd.h dynamicsizehash_concurrent.h
 EXTRA_DIST = dynamicsizehash.c dynamicsizehash_concurrent.c
-
-if !GPROF
-xmalloc_CFLAGS = -ffunction-sections
-endif
-- 
2.30.2