[Bug libdw/29695] New: In libelf.h struct Elf, struct Elf_Scn is defined using typedef and not using #include is not the way to comply with the specification?
https://sourceware.org/bugzilla/show_bug.cgi?id=29695 Bug ID: 29695 Summary: In libelf.h struct Elf, struct Elf_Scn is defined using typedef and not using #include is not the way to comply with the specification? Product: elfutils Version: unspecified Status: UNCONFIRMED Severity: normal Priority: P2 Component: libdw Assignee: unassigned at sourceware dot org Reporter: zhuorong.lin at outlook dot com CC: elfutils-devel at sourceware dot org Target Milestone: --- In the source code, libelf.h in the libelf directory is just typedef struct Elf, struct ElfScn, and the real definition is in libelfP.h, and there is no #include in libelf.h. Is directly typedef an undefined struct not in compliance with the specification. libelf.h ``` /* Archive symbol table entry. */ typedef struct { char *as_name;/* Symbol name. */ size_t as_off;/* Offset for this file in the archive. */ unsigned long int as_hash;/* Hash value of the name. */ } Elf_Arsym; /* Descriptor for the ELF file. */ typedef struct Elf Elf; /* Descriptor for ELF file section. */ typedef struct Elf_Scn Elf_Scn; #ifdef __cplusplus extern "C" { #endif /* Return descriptor for ELF file to work according to CMD. */ extern Elf *elf_begin (int __fildes, Elf_Cmd __cmd, Elf *__ref); /* Create a clone of an existing ELF descriptor. */ extern Elf *elf_clone (Elf *__elf, Elf_Cmd __cmd); /* Create descriptor for memory region. */ extern Elf *elf_memory (char *__image, size_t __size); /* Advance archive descriptor to next element. */ extern Elf_Cmd elf_next (Elf *__elf); ``` -- You are receiving this mail because: You are on the CC list for the bug.
[Bug libelf/29695] In libelf.h struct Elf, struct Elf_Scn is defined using typedef and not using #include is not the way to comply with the specification?
https://sourceware.org/bugzilla/show_bug.cgi?id=29695 lin zhuorong changed: What|Removed |Added Component|libdw |libelf CC||zhuorong.lin at outlook dot com -- You are receiving this mail because: You are on the CC list for the bug.
Re: [PATCH] libdwfl: add dwfl_report_offline_memory
Hi Aleksei, On Tue, Sep 20, 2022 at 01:36:37PM +, Aleksei Vetrov via Elfutils-devel wrote: > This method allows to read and report ELF from memory instead of opening > a file. That way arbitrary memory can be worked with, e.g. when coming > from a stream without the need to persist. > > Another useful application is for fuzzing, because fuzzers might be able > to track accesses to the memory and change the fuzzer input to cover > more edge cases through more targeted input. Hence, add a new function > along with a test case. This is a very nice patch. Pushed almost as is. While reviewing I added some ChangeLog entries. I added the NEWS entry. In libdw.map I moved dwfl_report_offline_memory under ELFUTILS_0.188. In the tests/Makefile.am I added libeu to dwfl_report_offline_memory_LDADD because the test uses error. Thanks, Mark
☠ Buildbot (GNU Toolchain): elfutils - failed test (failure) (master)
A new failure has been detected on builder elfutils-debian-arm64 while building elfutils. Full details are available at: https://builder.sourceware.org/buildbot/#builders/5/builds/74 Build state: failed test (failure) Revision: 64ee2cb792e7b6ba6ad2a5759bff7ce8714e4668 Worker: debian-arm64 Build Reason: (unknown) Blamelist: Aleksei Vetrov Steps: - 0: worker_preparation ( success ) - 1: set package name ( success ) - 2: git checkout ( success ) Logs: - stdio: https://builder.sourceware.org/buildbot/#builders/5/builds/74/steps/2/logs/stdio - 3: autoreconf ( success ) Logs: - stdio: https://builder.sourceware.org/buildbot/#builders/5/builds/74/steps/3/logs/stdio - 4: configure ( success ) Logs: - stdio: https://builder.sourceware.org/buildbot/#builders/5/builds/74/steps/4/logs/stdio - 5: get version ( success ) Logs: - stdio: https://builder.sourceware.org/buildbot/#builders/5/builds/74/steps/5/logs/stdio - property changes: https://builder.sourceware.org/buildbot/#builders/5/builds/74/steps/5/logs/property_changes - 6: make ( warnings ) Logs: - stdio: https://builder.sourceware.org/buildbot/#builders/5/builds/74/steps/6/logs/stdio - warnings (3): https://builder.sourceware.org/buildbot/#builders/5/builds/74/steps/6/logs/warnings__3_ - 7: make check ( failure ) Logs: - stdio: https://builder.sourceware.org/buildbot/#builders/5/builds/74/steps/7/logs/stdio - test-suite.log: https://builder.sourceware.org/buildbot/#builders/5/builds/74/steps/7/logs/test-suite_log - 8: prep ( success ) Logs: - stdio: https://builder.sourceware.org/buildbot/#builders/5/builds/74/steps/8/logs/stdio - 9: build bunsen.cpio.gz ( success ) Logs: - stdio: https://builder.sourceware.org/buildbot/#builders/5/builds/74/steps/9/logs/stdio - 10: fetch bunsen.cpio.gz ( success ) Logs: - stdio: https://builder.sourceware.org/buildbot/#builders/5/builds/74/steps/10/logs/stdio - 11: unpack bunsen.cpio.gz ( success ) Logs: - stdio: https://builder.sourceware.org/buildbot/#builders/5/builds/74/steps/11/logs/stdio - 12: pass .bunsen.source.gitname ( success ) Logs: - stdio: https://builder.sourceware.org/buildbot/#builders/5/builds/74/steps/12/logs/stdio - 13: pass .bunsen.source.gitdescribe ( success ) Logs: - stdio: https://builder.sourceware.org/buildbot/#builders/5/builds/74/steps/13/logs/stdio - 14: pass .bunsen.source.gitbranch ( success ) Logs: - stdio: https://builder.sourceware.org/buildbot/#builders/5/builds/74/steps/14/logs/stdio - 15: pass .bunsen.source.gitrepo ( success ) Logs: - stdio: https://builder.sourceware.org/buildbot/#builders/5/builds/74/steps/15/logs/stdio - 16: upload to bunsen ( success ) Logs: - stdio: https://builder.sourceware.org/buildbot/#builders/5/builds/74/steps/16/logs/stdio - 17: clean up ( success ) Logs: - stdio: https://builder.sourceware.org/buildbot/#builders/5/builds/74/steps/17/logs/stdio - 18: make distclean ( success ) Logs: - stdio: https://builder.sourceware.org/buildbot/#builders/5/builds/74/steps/18/logs/stdio A new failure has been detected on builder elfutils-debian-armhf while building elfutils. Full details are available at: https://builder.sourceware.org/buildbot/#builders/6/builds/75 Build state: failed test (failure) Revision: 64ee2cb792e7b6ba6ad2a5759bff7ce8714e4668 Worker: debian-armhf Build Reason: (unknown) Blamelist: Aleksei Vetrov Steps: - 0: worker_preparation ( success ) - 1: set package name ( success ) - 2: git checkout ( success ) Logs: - stdio: https://builder.sourceware.org/buildbot/#builders/6/builds/75/steps/2/logs/stdio - 3: autoreconf ( success ) Logs: - stdio: https://builder.sourceware.org/buildbot/#builders/6/builds/75/steps/3/logs/stdio - 4: configure ( success ) Logs: - stdio: https://builder.sourceware.org/buildbot/#builders/6/builds/75/steps/4/logs/stdio - 5: get version ( success ) Logs: - stdio: https://builder.sourceware.org/buildbot/#builders/6/builds/75/steps/5/logs/stdio - property changes: https://builder.sourceware.org/buildbot/#builders/6/builds/75/steps/5/logs/property_changes - 6: make ( warnings ) Logs: - stdio: https://builder.sourceware.org/buildbot/#builders/6/builds/75/steps/6/logs/stdio - warnings (3): https://builder.sourceware.org/buildbot/#builders/6/builds/75/steps/6/logs/warnings__3_ - 7: make check ( failure ) Logs: - stdio: https://builder.sourceware.org/buildbot/#builders/6/builds/75/steps/7/logs/stdio - test-suite.log: https://builder.sourceware.org/buildbot/#builders/6/builds/75/steps/7/logs/test-suite_log - 8: prep ( success ) Logs: - stdio: https://builder.sourceware.org/buildbot/#builders/6/builds/75/steps/8/logs/stdio - 9: build bun
Re: ☠ Buildbot (GNU Toolchain): elfutils - failed test (failure) (master)
There is a run-debuginfod-federation-metrics.sh failure that must be unrelated. It is an odd crash in the shell script wait statement? But there are also a few failures compiling the new testcase: In file included from /usr/include/features.h:490, from /usr/include/assert.h:35, from dwfl-report-offline-memory.c:18: In function ‘read’, inlined from ‘main’ at dwfl-report-offline-memory.c:68:23: /usr/include/bits/unistd.h:38:10: error: ‘__read_alias’ specified size 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Werror=stringop-overflow=] 38 | return __glibc_fortify (read, __nbytes, sizeof (char), | ^~~ /usr/include/bits/unistd.h: In function ‘main’: /usr/include/bits/unistd.h:26:16: note: in a call to function ‘__read_alias’ declared with attribute ‘access (write_only, 2, 3)’ 26 | extern ssize_t __REDIRECT (__read_alias, (int __fd, void *__buf, |^~ cc1: all warnings being treated as errors make[2]: *** [Makefile:2461: dwfl-report-offline-memory.o] Error 1 This seems technically correct since we use the wrong types size_t vs off_t and ssize_t and don't check the results from lseek, read and malloc. Patch to fix that attached. And there is an error on 32bit systems: tests/dwfl-report-offline-memory contains non-lfs symbols: lseek open Fix that by including config.h earlier. Cheers, Mark>From 72860bfdca5286399837080d53ba297bf72c56b3 Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Sun, 16 Oct 2022 18:02:46 +0200 Subject: [PATCH] tests: Check lseek, read and malloc results with correct types in test. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When compiling dwfl-report-offline-memory.c on some systems (latest gcc/glibc and --enable-sanitize-undefined) we might get: In file included from /usr/include/features.h:490, from /usr/include/assert.h:35, from dwfl-report-offline-memory.c:18: In function ‘read’, inlined from ‘main’ at dwfl-report-offline-memory.c:68:23: /usr/include/bits/unistd.h:38:10: error: ‘__read_alias’ specified size 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Werror=stringop-overflow=] 38 | return __glibc_fortify (read, __nbytes, sizeof (char), | ^~~ /usr/include/bits/unistd.h: In function ‘main’: /usr/include/bits/unistd.h:26:16: note: in a call to function ‘__read_alias’ declared with attribute ‘access (write_only, 2, 3)’ 26 | extern ssize_t __REDIRECT (__read_alias, (int __fd, void *__buf, |^~ cc1: all warnings being treated as errors make[2]: *** [Makefile:2461: dwfl-report-offline-memory.o] Error 1 Fix by using the correct types and checking all return values. Signed-off-by: Mark Wielaard --- tests/ChangeLog| 5 + tests/dwfl-report-offline-memory.c | 8 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/tests/ChangeLog b/tests/ChangeLog index 6ac2c1e8..d07a910e 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,8 @@ +2022-10-16 Mark Wielaard + + * dwfl-report-offline-memory.c (main): Check lseek, read and malloc + results with correct types. + 2022-09-13 Aleksei Vetrov * Makefile.am (check_PROGRAMS): Add dwfl-report-offline-memory. diff --git a/tests/dwfl-report-offline-memory.c b/tests/dwfl-report-offline-memory.c index 837aca5e..81fa136f 100644 --- a/tests/dwfl-report-offline-memory.c +++ b/tests/dwfl-report-offline-memory.c @@ -62,10 +62,14 @@ main (int argc, char **argv) int fd = open (fname, O_RDONLY); if (fd < 0) error (-1, 0, "can't open file %s: %s", fname, strerror (errno)); - size_t size = lseek (fd, 0, SEEK_END); + off_t size = lseek (fd, 0, SEEK_END); + if (size < 0) +error (-1, 0, "can't lseek file %s: %s", fname, strerror (errno)); lseek (fd, 0, SEEK_SET); char *data = malloc (size); - size_t bytes_read = read (fd, data, size); + if (data == NULL) +error (-1, 0, "can't malloc: %s", strerror (errno)); + ssize_t bytes_read = read (fd, data, size); assert (bytes_read == size); close (fd); -- 2.30.2 >From 2a4ce08fafcf76d866ae5f6b394389d8d93aa0cb Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Sun, 16 Oct 2022 18:23:06 +0200 Subject: [PATCH] tests: include config.h first. Otherwise some symbols (lseek, open) might not get the 64bit offset variants because they don't pick up _FILE_OFFSET_BITS. Signed-off-by: Mark Wielaard --- tests/ChangeLog| 4 tests/dwfl-report-offline-memory.c | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/ChangeLog b/tests/ChangeLog index d07a910e..0ea1df3d 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,7 @@ +2022-10-16 Mark Wielaard + + * dwfl-report-offline-memory.c: Include config.h first. + 2022-10-16 Mark Wielaard * dwfl-report-offline-memory.c
☺ Buildbot (GNU Toolchain): elfutils - build successful (master)
A restored build has been detected on builder elfutils-debian-armhf while building elfutils. Full details are available at: https://builder.sourceware.org/buildbot/#builders/6/builds/77 Build state: build successful Revision: 2a4ce08fafcf76d866ae5f6b394389d8d93aa0cb Worker: debian-armhf Build Reason: (unknown) Blamelist: Aleksei Vetrov , Mark Wielaard Steps: - 0: worker_preparation ( success ) - 1: set package name ( success ) - 2: git checkout ( success ) Logs: - stdio: https://builder.sourceware.org/buildbot/#builders/6/builds/77/steps/2/logs/stdio - 3: autoreconf ( success ) Logs: - stdio: https://builder.sourceware.org/buildbot/#builders/6/builds/77/steps/3/logs/stdio - 4: configure ( success ) Logs: - stdio: https://builder.sourceware.org/buildbot/#builders/6/builds/77/steps/4/logs/stdio - 5: get version ( success ) Logs: - stdio: https://builder.sourceware.org/buildbot/#builders/6/builds/77/steps/5/logs/stdio - property changes: https://builder.sourceware.org/buildbot/#builders/6/builds/77/steps/5/logs/property_changes - 6: make ( warnings ) Logs: - stdio: https://builder.sourceware.org/buildbot/#builders/6/builds/77/steps/6/logs/stdio - warnings (3): https://builder.sourceware.org/buildbot/#builders/6/builds/77/steps/6/logs/warnings__3_ - 7: make check ( success ) Logs: - stdio: https://builder.sourceware.org/buildbot/#builders/6/builds/77/steps/7/logs/stdio - test-suite.log: https://builder.sourceware.org/buildbot/#builders/6/builds/77/steps/7/logs/test-suite_log - 8: prep ( success ) Logs: - stdio: https://builder.sourceware.org/buildbot/#builders/6/builds/77/steps/8/logs/stdio - 9: build bunsen.cpio.gz ( success ) Logs: - stdio: https://builder.sourceware.org/buildbot/#builders/6/builds/77/steps/9/logs/stdio - 10: fetch bunsen.cpio.gz ( success ) Logs: - stdio: https://builder.sourceware.org/buildbot/#builders/6/builds/77/steps/10/logs/stdio - 11: unpack bunsen.cpio.gz ( success ) Logs: - stdio: https://builder.sourceware.org/buildbot/#builders/6/builds/77/steps/11/logs/stdio - 12: pass .bunsen.source.gitname ( success ) Logs: - stdio: https://builder.sourceware.org/buildbot/#builders/6/builds/77/steps/12/logs/stdio - 13: pass .bunsen.source.gitdescribe ( success ) Logs: - stdio: https://builder.sourceware.org/buildbot/#builders/6/builds/77/steps/13/logs/stdio - 14: pass .bunsen.source.gitbranch ( success ) Logs: - stdio: https://builder.sourceware.org/buildbot/#builders/6/builds/77/steps/14/logs/stdio - 15: pass .bunsen.source.gitrepo ( success ) Logs: - stdio: https://builder.sourceware.org/buildbot/#builders/6/builds/77/steps/15/logs/stdio - 16: upload to bunsen ( success ) Logs: - stdio: https://builder.sourceware.org/buildbot/#builders/6/builds/77/steps/16/logs/stdio - 17: clean up ( success ) Logs: - stdio: https://builder.sourceware.org/buildbot/#builders/6/builds/77/steps/17/logs/stdio - 18: make distclean ( success ) Logs: - stdio: https://builder.sourceware.org/buildbot/#builders/6/builds/77/steps/18/logs/stdio A failed build has been detected on builder elfutils-debian-testing-x86_64 while building elfutils. Full details are available at: https://builder.sourceware.org/buildbot/#builders/145/builds/40 Build state: failed test (failure) test (failure) Revision: 2a4ce08fafcf76d866ae5f6b394389d8d93aa0cb Worker: bbo1-1 Build Reason: (unknown) Blamelist: Aaron Merey , Aleksei Vetrov , Frank Ch. Eigler , Khem Raj , Mark Wielaard , Martin Liska , 河辺 岳人 Steps: - 0: worker_preparation ( success ) - 1: set package name ( success ) - 2: git checkout ( success ) Logs: - stdio: https://builder.sourceware.org/buildbot/#builders/145/builds/40/steps/2/logs/stdio - 3: autoreconf ( success ) Logs: - stdio: https://builder.sourceware.org/buildbot/#builders/145/builds/40/steps/3/logs/stdio - 4: configure ( success ) Logs: - stdio: https://builder.sourceware.org/buildbot/#builders/145/builds/40/steps/4/logs/stdio - 5: get version ( success ) Logs: - stdio: https://builder.sourceware.org/buildbot/#builders/145/builds/40/steps/5/logs/stdio - property changes: https://builder.sourceware.org/buildbot/#builders/145/builds/40/steps/5/logs/property_changes - 6: make ( warnings ) Logs: - stdio: https://builder.sourceware.org/buildbot/#builders/145/builds/40/steps/6/logs/stdio - warnings (3): https://builder.sourceware.org/buildbot/#builders/145/builds/40/steps/6/logs/warnings__3_ - 7: make check ( failure ) Logs: - stdio: https://builder.sourceware.org/buildbot/#builders/145/builds/40/steps/7/logs/stdio - test-suite.log: https://builder.sourceware.org/buildbot/#builders/145/builds/40/steps/7/logs/test-suite_log - 8: ma
Re: [PATCH v2 2/7] move platform depended include into system.h of libelf
On Sun, Oct 16, 2022 at 12:36:20AM +0800, Yonggang Luo via Elfutils-devel wrote: > All of these files either #include directly or #include "libelfP.h" > And now "libelfP.h also #include , so the platform depended include > can be moved to system.h safely Thanks. While reviewing wrote ChangeLog entries. Pushed with those added. Cheers, Mark
Re: [PATCH v2 3/7] Move the #include into eu-config.h
On Sun, Oct 16, 2022 at 12:36:21AM +0800, Yonggang Luo via Elfutils-devel wrote: > So we do not need include in each file. > And indeed the macro > #define _(Str) dgettext ("elfutils", Str) > access libintl function dgettext, so it's make more sense > #include in file eu-config.h And this works because we include eu-config.h in config.h. All files where libintl.h is removed includes config.h, except for libdwP.h and libeblP.h, but it isn't expected there. Pushed, Mark
Re: [PATCH v2 4/7] lib: Use NOT_HAVE_LIBINTL to guard #include
Hi, On Sun, Oct 16, 2022 at 12:36:22AM +0800, Yonggang Luo via Elfutils-devel wrote: > Add NOT_HAVE_LIBINTL macro to disable internationalization, > sometimes we have don't want access internationalization such as MSVC, > so the macro NOT_HAVE_LIBINTL can help that. This needs a configure check. Cheers, Mark
☠ Buildbot (GNU Toolchain): elfutils - failed test (failure) (master)
A new failure has been detected on builder elfutils-fedora-s390x while building elfutils. Full details are available at: https://builder.sourceware.org/buildbot/#builders/43/builds/78 Build state: failed test (failure) Revision: a6b2ec76d51386dd06ab86d46eabbcf5140fe80d Worker: fedora-s390x Build Reason: (unknown) Blamelist: Yonggang Luo Steps: - 0: worker_preparation ( success ) - 1: set package name ( success ) - 2: git checkout ( success ) Logs: - stdio: https://builder.sourceware.org/buildbot/#builders/43/builds/78/steps/2/logs/stdio - 3: autoreconf ( success ) Logs: - stdio: https://builder.sourceware.org/buildbot/#builders/43/builds/78/steps/3/logs/stdio - 4: configure ( success ) Logs: - stdio: https://builder.sourceware.org/buildbot/#builders/43/builds/78/steps/4/logs/stdio - 5: get version ( success ) Logs: - stdio: https://builder.sourceware.org/buildbot/#builders/43/builds/78/steps/5/logs/stdio - property changes: https://builder.sourceware.org/buildbot/#builders/43/builds/78/steps/5/logs/property_changes - 6: make ( warnings ) Logs: - stdio: https://builder.sourceware.org/buildbot/#builders/43/builds/78/steps/6/logs/stdio - warnings (3): https://builder.sourceware.org/buildbot/#builders/43/builds/78/steps/6/logs/warnings__3_ - 7: make check ( failure ) Logs: - stdio: https://builder.sourceware.org/buildbot/#builders/43/builds/78/steps/7/logs/stdio - test-suite.log: https://builder.sourceware.org/buildbot/#builders/43/builds/78/steps/7/logs/test-suite_log - 8: prep ( success ) Logs: - stdio: https://builder.sourceware.org/buildbot/#builders/43/builds/78/steps/8/logs/stdio - 9: build bunsen.cpio.gz ( success ) Logs: - stdio: https://builder.sourceware.org/buildbot/#builders/43/builds/78/steps/9/logs/stdio - 10: fetch bunsen.cpio.gz ( success ) Logs: - stdio: https://builder.sourceware.org/buildbot/#builders/43/builds/78/steps/10/logs/stdio - 11: unpack bunsen.cpio.gz ( success ) Logs: - stdio: https://builder.sourceware.org/buildbot/#builders/43/builds/78/steps/11/logs/stdio - 12: pass .bunsen.source.gitname ( success ) Logs: - stdio: https://builder.sourceware.org/buildbot/#builders/43/builds/78/steps/12/logs/stdio - 13: pass .bunsen.source.gitdescribe ( success ) Logs: - stdio: https://builder.sourceware.org/buildbot/#builders/43/builds/78/steps/13/logs/stdio - 14: pass .bunsen.source.gitbranch ( success ) Logs: - stdio: https://builder.sourceware.org/buildbot/#builders/43/builds/78/steps/14/logs/stdio - 15: pass .bunsen.source.gitrepo ( success ) Logs: - stdio: https://builder.sourceware.org/buildbot/#builders/43/builds/78/steps/15/logs/stdio - 16: upload to bunsen ( success ) Logs: - stdio: https://builder.sourceware.org/buildbot/#builders/43/builds/78/steps/16/logs/stdio - 17: clean up ( success ) Logs: - stdio: https://builder.sourceware.org/buildbot/#builders/43/builds/78/steps/17/logs/stdio - 18: make distclean ( success ) Logs: - stdio: https://builder.sourceware.org/buildbot/#builders/43/builds/78/steps/18/logs/stdio
Re: [PATCH 5/7] Strip __ prefix from __BYTE_ORDER __LITTLE_ENDIAN and __BIG_ENDIAN
Hi, This seems to work and is probably OK. But do you know when/what the __ prefix versions are defined and when/what defines the non-prefixed versions? Thanks, Mark On Tue, Sep 20, 2022 at 04:43:05PM +0800, Yonggang Luo via Elfutils-devel wrote: > Signed-off-by: Yonggang Luo > --- > lib/system.h | 4 ++-- > libcpu/i386_disasm.c | 2 +- > libcpu/memory-access.h | 26 +- > libcpu/riscv_disasm.c| 2 +- > libdw/memory-access.h| 8 > libdwfl/dwfl_segment_report_module.c | 2 +- > libelf/common.h | 2 +- > libelf/elf32_checksum.c | 4 ++-- > libelf/elf32_xlatetof.c | 4 ++-- > libelf/elf_getarsym.c| 6 +++--- > src/arlib.h | 2 +- > 11 files changed, 31 insertions(+), 31 deletions(-) > > diff --git a/lib/system.h b/lib/system.h > index 48004df1..bbbe06c4 100644 > --- a/lib/system.h > +++ b/lib/system.h > @@ -64,12 +64,12 @@ void error(int status, int errnum, const char *format, > ...); > exit (EXIT_FAILURE); \ >} while (0) > > -#if __BYTE_ORDER == __LITTLE_ENDIAN > +#if BYTE_ORDER == LITTLE_ENDIAN > # define LE32(n) (n) > # define LE64(n) (n) > # define BE32(n) bswap_32 (n) > # define BE64(n) bswap_64 (n) > -#elif __BYTE_ORDER == __BIG_ENDIAN > +#elif BYTE_ORDER == BIG_ENDIAN > # define BE32(n) (n) > # define BE64(n) (n) > # define LE32(n) bswap_32 (n) > diff --git a/libcpu/i386_disasm.c b/libcpu/i386_disasm.c > index fd7340cc..40475b81 100644 > --- a/libcpu/i386_disasm.c > +++ b/libcpu/i386_disasm.c > @@ -44,7 +44,7 @@ > > #include "../libebl/libeblP.h" > > -#define MACHINE_ENCODING __LITTLE_ENDIAN > +#define MACHINE_ENCODING LITTLE_ENDIAN > #include "memory-access.h" > > > diff --git a/libcpu/memory-access.h b/libcpu/memory-access.h > index 779825fa..3b6ca19b 100644 > --- a/libcpu/memory-access.h > +++ b/libcpu/memory-access.h > @@ -41,7 +41,7 @@ > #ifndef MACHINE_ENCODING > # error "MACHINE_ENCODING needs to be defined" > #endif > -#if MACHINE_ENCODING != __BIG_ENDIAN && MACHINE_ENCODING != __LITTLE_ENDIAN > +#if MACHINE_ENCODING != BIG_ENDIAN && MACHINE_ENCODING != LITTLE_ENDIAN > # error "MACHINE_ENCODING must signal either big or little endian" > #endif > > @@ -51,31 +51,31 @@ > #if ALLOW_UNALIGNED > > # define read_2ubyte_unaligned(Addr) \ > - (unlikely (MACHINE_ENCODING != __BYTE_ORDER) > \ > + (unlikely (MACHINE_ENCODING != BYTE_ORDER) \ > ? bswap_16 (*((const uint16_t *) (Addr))) \ > : *((const uint16_t *) (Addr))) > # define read_2sbyte_unaligned(Addr) \ > - (unlikely (MACHINE_ENCODING != __BYTE_ORDER) > \ > + (unlikely (MACHINE_ENCODING != BYTE_ORDER) \ > ? (int16_t) bswap_16 (*((const int16_t *) (Addr))) > \ > : *((const int16_t *) (Addr))) > > # define read_4ubyte_unaligned_noncvt(Addr) \ > *((const uint32_t *) (Addr)) > # define read_4ubyte_unaligned(Addr) \ > - (unlikely (MACHINE_ENCODING != __BYTE_ORDER) > \ > + (unlikely (MACHINE_ENCODING != BYTE_ORDER) \ > ? bswap_32 (*((const uint32_t *) (Addr))) \ > : *((const uint32_t *) (Addr))) > # define read_4sbyte_unaligned(Addr) \ > - (unlikely (MACHINE_ENCODING != __BYTE_ORDER) > \ > + (unlikely (MACHINE_ENCODING != BYTE_ORDER) \ > ? (int32_t) bswap_32 (*((const int32_t *) (Addr))) > \ > : *((const int32_t *) (Addr))) > > # define read_8ubyte_unaligned(Addr) \ > - (unlikely (MACHINE_ENCODING != __BYTE_ORDER) > \ > + (unlikely (MACHINE_ENCODING != BYTE_ORDER) \ > ? bswap_64 (*((const uint64_t *) (Addr))) \ > : *((const uint64_t *) (Addr))) > # define read_8sbyte_unaligned(Addr) \ > - (unlikely (MACHINE_ENCODING != __BYTE_ORDER) > \ > + (unlikely (MACHINE_ENCODING != BYTE_ORDER) \ > ? (int64_t) bswap_64 (*((const int64_t *) (Addr))) > \ > : *((const int64_t *) (Addr))) > > @@ -96,7 +96,7 @@ static inline uint16_t > read_2ubyte_unaligned (const void *p) > { >const union unaligned *up = p; > - if (MACHINE_ENCODING != __BYTE_ORDER) > + if (MACHINE_ENCODING != BYTE_ORDER) > return bswap_16 (up->u2); >return up->u2; > } > @@ -104,7 +104,7 @@ static inline int16_t > read_2sbyte_unaligned (const void *p) > { >const union unaligned *up = p; > - if (MACHINE_ENCODING != __BYTE_ORDER) > + if (MACHINE_ENC
☺ Buildbot (GNU Toolchain): elfutils - build successful (master)
A restored build has been detected on builder elfutils-fedora-s390x while building elfutils. Full details are available at: https://builder.sourceware.org/buildbot/#builders/43/builds/79 Build state: build successful Revision: 96263dfee3591a9c732b00a33a4a221b8f01bf46 Worker: fedora-s390x Build Reason: (unknown) Blamelist: Yonggang Luo Steps: - 0: worker_preparation ( success ) - 1: set package name ( success ) - 2: git checkout ( success ) Logs: - stdio: https://builder.sourceware.org/buildbot/#builders/43/builds/79/steps/2/logs/stdio - 3: autoreconf ( success ) Logs: - stdio: https://builder.sourceware.org/buildbot/#builders/43/builds/79/steps/3/logs/stdio - 4: configure ( success ) Logs: - stdio: https://builder.sourceware.org/buildbot/#builders/43/builds/79/steps/4/logs/stdio - 5: get version ( success ) Logs: - stdio: https://builder.sourceware.org/buildbot/#builders/43/builds/79/steps/5/logs/stdio - property changes: https://builder.sourceware.org/buildbot/#builders/43/builds/79/steps/5/logs/property_changes - 6: make ( warnings ) Logs: - stdio: https://builder.sourceware.org/buildbot/#builders/43/builds/79/steps/6/logs/stdio - warnings (3): https://builder.sourceware.org/buildbot/#builders/43/builds/79/steps/6/logs/warnings__3_ - 7: make check ( success ) Logs: - stdio: https://builder.sourceware.org/buildbot/#builders/43/builds/79/steps/7/logs/stdio - test-suite.log: https://builder.sourceware.org/buildbot/#builders/43/builds/79/steps/7/logs/test-suite_log - 8: prep ( success ) Logs: - stdio: https://builder.sourceware.org/buildbot/#builders/43/builds/79/steps/8/logs/stdio - 9: build bunsen.cpio.gz ( success ) Logs: - stdio: https://builder.sourceware.org/buildbot/#builders/43/builds/79/steps/9/logs/stdio - 10: fetch bunsen.cpio.gz ( success ) Logs: - stdio: https://builder.sourceware.org/buildbot/#builders/43/builds/79/steps/10/logs/stdio - 11: unpack bunsen.cpio.gz ( success ) Logs: - stdio: https://builder.sourceware.org/buildbot/#builders/43/builds/79/steps/11/logs/stdio - 12: pass .bunsen.source.gitname ( success ) Logs: - stdio: https://builder.sourceware.org/buildbot/#builders/43/builds/79/steps/12/logs/stdio - 13: pass .bunsen.source.gitdescribe ( success ) Logs: - stdio: https://builder.sourceware.org/buildbot/#builders/43/builds/79/steps/13/logs/stdio - 14: pass .bunsen.source.gitbranch ( success ) Logs: - stdio: https://builder.sourceware.org/buildbot/#builders/43/builds/79/steps/14/logs/stdio - 15: pass .bunsen.source.gitrepo ( success ) Logs: - stdio: https://builder.sourceware.org/buildbot/#builders/43/builds/79/steps/15/logs/stdio - 16: upload to bunsen ( success ) Logs: - stdio: https://builder.sourceware.org/buildbot/#builders/43/builds/79/steps/16/logs/stdio - 17: clean up ( success ) Logs: - stdio: https://builder.sourceware.org/buildbot/#builders/43/builds/79/steps/17/logs/stdio - 18: make distclean ( success ) Logs: - stdio: https://builder.sourceware.org/buildbot/#builders/43/builds/79/steps/18/logs/stdio
Re: [PATCH 6/7] Fixes building with msvc/clang mingw/gcc
Hi, I find this hard to review. I have no experienc with msvc and don't know when/what _MSC_VER implies or how to verify system_win32.c. I am also a bit worried that the various ifdefs will be hard to keep correct. If we don't have HAVE_DECL_MMAP does the testsuite still work? Maybe this patch can be split up is separate concerns. But I have to admit I am a litle afraid this will be hard to keep working. Cheers, Mark
Re: [PATCH 7/7] Add CMake build files
Hi, I rather not have multiple build systems in the tree. Are the autotools not available on your system? Cheers, Mark
Re: [PATCH 5/7] Strip __ prefix from __BYTE_ORDER __LITTLE_ENDIAN and __BIG_ENDIAN
On Mon, Oct 17, 2022 at 5:11 AM Mark Wielaard wrote: > > Hi, > > This seems to work and is probably OK. But do you know when/what the > __ prefix versions are defined and when/what defines the non-prefixed > versions? > __BYTE_ORDER__ is a predefined macro by gcc/clang, BYTE_ORDER is defined in -- 此致 礼 罗勇刚 Yours sincerely, Yonggang Luo