git: 7da77f0266f1 - stable/13 - Stop #defining FREEBSD_ELF

From: John Baldwin <jhb_at_FreeBSD.org>
Date: Fri, 05 Jan 2024 00:48:43 UTC
The branch stable/13 has been updated by jhb:

URL: https://cgit.FreeBSD.org/src/commit/?id=7da77f0266f19696ae1221215f9c9998e686f90c

commit 7da77f0266f19696ae1221215f9c9998e686f90c
Author:     John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2023-12-12 23:30:00 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: 2024-01-05 00:28:53 +0000

    Stop #defining FREEBSD_ELF
    
    This was originally used (along with FREEBSD_AOUT) to prefer the use
    of ELF in various tools instead of a.out as part of the a.out to ELF
    transition in the 3.x days.  The last use of it was removed from
    <link.h> in commit 66422f5b7a1a6055f0b2358268eb902aab6e2e3e back in
    2002, but various files still #define it.
    
    Reviewed by:    kevans, imp, emaste
    Sponsored by:   DARPA
    Differential Revision:  https://reviews.freebsd.org/D42964
    
    (cherry picked from commit 4a3cf5f329d69076aa9d093d596eb0ee82d917f5)
---
 libexec/rtld-elf/Makefile   | 2 +-
 stand/common/load_elf.c     | 1 -
 stand/common/load_elf_obj.c | 1 -
 stand/common/reloc_elf.c    | 1 -
 usr.sbin/kldxref/ef.c       | 1 -
 usr.sbin/kldxref/ef_obj.c   | 1 -
 usr.sbin/kldxref/kldxref.c  | 1 -
 7 files changed, 1 insertion(+), 7 deletions(-)

diff --git a/libexec/rtld-elf/Makefile b/libexec/rtld-elf/Makefile
index ee862f650329..b95adf82fe9b 100644
--- a/libexec/rtld-elf/Makefile
+++ b/libexec/rtld-elf/Makefile
@@ -31,7 +31,7 @@ SRCS= \
 	libmap.c
 MAN?=		rtld.1
 ACFLAGS+=	-DLOCORE
-CFLAGS+=	-Wall -DFREEBSD_ELF -DIN_RTLD -ffreestanding
+CFLAGS+=	-Wall -DIN_RTLD -ffreestanding
 CFLAGS+=	-I${SRCTOP}/lib/csu/common
 .if exists(${RTLD_ELF_DIR}/${MACHINE_ARCH:S/powerpc64le/powerpc64/})
 RTLD_ARCH=	${MACHINE_ARCH:S/powerpc64le/powerpc64/}
diff --git a/stand/common/load_elf.c b/stand/common/load_elf.c
index 9f3b015fef7e..bd9ab9e7ec5b 100644
--- a/stand/common/load_elf.c
+++ b/stand/common/load_elf.c
@@ -35,7 +35,6 @@
 #include <string.h>
 #include <machine/elf.h>
 #include <stand.h>
-#define FREEBSD_ELF
 #include <sys/link_elf.h>
 
 #include "bootstrap.h"
diff --git a/stand/common/load_elf_obj.c b/stand/common/load_elf_obj.c
index 86e0fb2b5d22..6906e08f5f36 100644
--- a/stand/common/load_elf_obj.c
+++ b/stand/common/load_elf_obj.c
@@ -35,7 +35,6 @@
 #include <string.h>
 #include <machine/elf.h>
 #include <stand.h>
-#define FREEBSD_ELF
 #include <sys/link_elf.h>
 
 #include "bootstrap.h"
diff --git a/stand/common/reloc_elf.c b/stand/common/reloc_elf.c
index 47435dd78f6c..02e030016e17 100644
--- a/stand/common/reloc_elf.c
+++ b/stand/common/reloc_elf.c
@@ -33,7 +33,6 @@
 
 #include <stand.h>
 
-#define FREEBSD_ELF
 #include <sys/link_elf.h>
 
 #include "bootstrap.h"
diff --git a/usr.sbin/kldxref/ef.c b/usr.sbin/kldxref/ef.c
index 5d052cc90a6c..72e023e30783 100644
--- a/usr.sbin/kldxref/ef.c
+++ b/usr.sbin/kldxref/ef.c
@@ -43,7 +43,6 @@
 #include <string.h>
 #include <unistd.h>
 #include <machine/elf.h>
-#define FREEBSD_ELF
 
 #include "ef.h"
 
diff --git a/usr.sbin/kldxref/ef_obj.c b/usr.sbin/kldxref/ef_obj.c
index 953e54dc0d28..027408876a5e 100644
--- a/usr.sbin/kldxref/ef_obj.c
+++ b/usr.sbin/kldxref/ef_obj.c
@@ -45,7 +45,6 @@
 #include <string.h>
 #include <unistd.h>
 #include <machine/elf.h>
-#define FREEBSD_ELF
 
 #include "ef.h"
 
diff --git a/usr.sbin/kldxref/kldxref.c b/usr.sbin/kldxref/kldxref.c
index 154cf90a597f..f91571a4ef11 100644
--- a/usr.sbin/kldxref/kldxref.c
+++ b/usr.sbin/kldxref/kldxref.c
@@ -42,7 +42,6 @@
 #include <sys/linker.h>
 #include <sys/stat.h>
 #include <sys/module.h>
-#define FREEBSD_ELF
 
 #include <ctype.h>
 #include <err.h>