Page MenuHomeFreeBSD

Adding well-known ELF note values in elf_common.h
Needs ReviewPublic

Authored by naito.yuichiro_gmail.com on Aug 30 2019, 1:35 AM.
Tags
None
Referenced Files
Unknown Object (File)
Feb 5 2024, 2:24 AM
Unknown Object (File)
Feb 4 2024, 5:47 PM
Unknown Object (File)
Feb 3 2024, 6:17 AM
Unknown Object (File)
Jan 31 2024, 12:03 PM
Unknown Object (File)
Dec 23 2023, 1:32 AM
Unknown Object (File)
Dec 12 2023, 11:51 AM
Unknown Object (File)
Nov 14 2023, 11:22 AM
Unknown Object (File)
Aug 26 2023, 1:05 AM
Subscribers

Details

Reviewers
emaste
Summary

This patch solves https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=239669.
And I found imgact_elf.c refers to ELF note values, it seems same values of my patch.
I think static values should be defined in the header file.

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

Thank you for the submission - I committed a portion of the new #defines in rS352551.

sys/sys/elf_common.h
818–823

Do these #defines match a Linux header? These are GNU-specific #defines, and unless we specifically choose to use these for compatibility they ought to have GNU in the name.

sys/sys/elf_common.h
818–823

I say yes about following definitions.

ELF_NOTE_OS_LINUX
ELF_NOTE_OS_GNU
ELF_NOTE_OS_SOLARIS2
ELF_NOTE_OS_FREEBSD.

And say No about ELF_NOTE_OS_NETBSD. It's my creation.

I refered to NetBSD's sys/sys/exec_elf.h.
NetBSD defines as follows.

/* GNU-specific OS/version value stuff */
#define ELF_NOTE_ABI_OS_LINUX           0
#define ELF_NOTE_ABI_OS_HURD            1
#define ELF_NOTE_ABI_OS_SOLARIS         2
#define ELF_NOTE_ABI_OS_KFREEBSD        3
#define ELF_NOTE_ABI_OS_KNETBSD         4

I don't have specific reason to keep compatibility to GNU for these definitions.
Following NetBSD definition seems good in this point.

But we have already followed GNU's definition for ELF note names.
(e.g. #define ELF_NOTE_GNU "GNU")

It will make our elf_common.h consitent by keeping compatibility to GNU.
(e.g. NetBSD defines #define ELF_NOTE_GNU_NAME "GNU\0")

This review is obsoleted. Now valgrind in ports works fine.
Please close this review.
I can't see close menu or button in the web UI.