You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by ac...@apache.org on 2026/10/12 10:58:14 UTC

(nuttx) 01/03: elf: add macro SELFMAG to align standard used

This is an automated email from the ASF dual-hosted git repository.

acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit e2b33cba440ae3ad8be789685a97154018a5a57c
Author: yezhonghui <ye...@xiaomi.com>
AuthorDate: Wed Jan 28 10:18:07 2026 +0800

    elf: add macro SELFMAG to align standard used
    
    SELFMAG is the length of ELFMAG.  The C library of other systems
    defines it in <elf.h>, and programs use it with memcmp() to check
    the magic number of an ELF file.
    
    Signed-off-by: yezhonghui <ye...@xiaomi.com>
    Signed-off-by: Marco Casaroli <ma...@gmail.com>
---
 include/elf.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/elf.h b/include/elf.h
index fdecf44c075..75475d4aa54 100644
--- a/include/elf.h
+++ b/include/elf.h
@@ -119,6 +119,7 @@
 #define ELFMAG2            'L'
 #define ELFMAG3            'F'
 #define ELFMAG             "\177ELF"
+#define SELFMAG            4
 
 /* Table 3. Values for EI_CLASS */