Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 11 Sep 2013 09:21:15 +0100
From:      Andrew Turner <andrew@fubar.geek.nz>
To:        Warner Losh <imp@bsdimp.com>
Cc:        "freebsd-arm@freebsd.org" <arm@FreeBSD.org>, embedded@freebsd.org
Subject:   Re: CVS commit: src/lib/csu
Message-ID:  <20130911092115.139716ce@bender.Home>
In-Reply-To: <38D6DE4E-C4E3-4239-A198-51D6AC7711AC@bsdimp.com>
References:  <24478.1378868144@splode.eterna.com.au> <38D6DE4E-C4E3-4239-A198-51D6AC7711AC@bsdimp.com>

next in thread | previous in thread | raw e-mail | index | archive | help
--MP_/7I9gKVU3Ja9d2NG/i=iDi=g
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

On Tue, 10 Sep 2013 21:12:51 -0600
Warner Losh <imp@bsdimp.com> wrote:

> Perhaps we should do it too...  I also like this elf-notes.html idea
> too...

Something like the patch I've attached from the thread at [1]? It adds
a MACHINE_ARCH note type.

Andrew

[1]
http://lists.freebsd.org/pipermail/freebsd-arch/2013-July/014482.html

> Warner
> 
> Begin forwarded message:
> 
> > From: matthew green <mrg@eterna.com.au>
> > Date: September 10, 2013 8:55:44 PM MDT
> > To: source-changes-d@NetBSD.org
> > Cc: matt@NetBSD.org
> > Subject: re: CVS commit: src/lib/csu
> > 
> > 
> >> Module Name:	src
> >> Committed By:	matt
> >> Date:		Tue Sep 10 16:45:33 UTC 2013
> >> 
> >> Modified Files:
> >> 	src/lib/csu: Makefile
> >> 	src/lib/csu/arch/earm: Makefile.inc
> >> 	src/lib/csu/common: Makefile.inc sysident.S
> >> sysident_assym.cf
> >> 
> >> Log Message:
> >> Add support for a NetBSD MARCH elf note to record the MACHINE_ARCH
> >> for which a program was compiled.
> > 
> > please update this doc:
> > 
> >   http://www.netbsd.org/docs/kernel/elf-notes.html
> > 
> > and perhaps remove the link to cgd while you're at it ;)
> > 
> > thanks.
> > 
> > 
> > .mrg.
> 
> _______________________________________________
> freebsd-arm@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-arm
> To unsubscribe, send any mail to "freebsd-arm-unsubscribe@freebsd.org"
> 
> 


--MP_/7I9gKVU3Ja9d2NG/i=iDi=g
Content-Type: text/x-patch
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename=machine_arch_note.diff

Index: lib/csu/common/crtbrand.c
===================================================================
--- lib/csu/common/crtbrand.c	(revision 252514)
+++ lib/csu/common/crtbrand.c	(working copy)
@@ -64,3 +64,17 @@
 	.name = NOTE_FREEBSD_VENDOR,
 	.desc = __FreeBSD_version
 };
+
+static const struct {
+	int32_t	namesz;
+	int32_t	descsz;
+	int32_t	type;
+	char	name[sizeof(NOTE_FREEBSD_VENDOR)];
+	char	desc[sizeof(MACHINE_ARCH)];
+} archtag __attribute__ ((section (NOTE_SECTION), aligned(4))) __used = {
+	.namesz = sizeof(NOTE_FREEBSD_VENDOR),
+	.descsz = sizeof(MACHINE_ARCH),
+	.type = ARCH_NOTETYPE,
+	.name = NOTE_FREEBSD_VENDOR,
+	.desc = MACHINE_ARCH
+};
Index: lib/csu/common/notes.h
===================================================================
--- lib/csu/common/notes.h	(revision 252514)
+++ lib/csu/common/notes.h	(working copy)
@@ -34,5 +34,6 @@
 
 #define ABI_NOTETYPE		1
 #define	CRT_NOINIT_NOTETYPE	2
+#define	ARCH_NOTETYPE		3
 
 #endif

--MP_/7I9gKVU3Ja9d2NG/i=iDi=g--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20130911092115.139716ce>