Commit Graph

16 Commits

Author SHA1 Message Date
Warner Losh
1987e300d0 Explicitly ignore return value from remove. We wouldn't do anything
differently if we can't unlink the temporary file. Also, free the
temporary file name when we set it to NULL.

CID: 1006909, 719448
2017-12-28 05:33:19 +00:00
Pedro F. Giffuni
1de7b4b805 various: general adoption of SPDX licensing ID tags.
Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

No functional change intended.
2017-11-27 15:37:16 +00:00
Pedro F. Giffuni
c4c510be1e Reuse our roundup2() macro instead of reinventing the wheel.
Obtained from:	DragonflyBSD
2016-04-18 17:30:33 +00:00
Christian Brueffer
419749b63a In puthdr(), start the ELF .data section on a new page, as this is
what btxldr expects (.set MEM_DATA,start+0x1000 in btxldr.S).

This makes resulting ELF binaries bootable with grub, gptboot and boot2.

PR:		153801
Submitted by:	Gleb Kurtsou <gleb.kurtsou at gmail.com>
Tested by:	Ruben Kerkhof <ruben at rubenkerkhof.com>
Glanced at by:	jhb, peter
MFC after:	1 month
2014-02-25 17:13:42 +00:00
Warner Losh
9f85041125 The boot loader is a FreeBSD a.out binary for x86, not a VAX binary.
Rather than writing out a MID of '0', write a MID of 0x86 (aka
MID_I386) so that file gets it right.

This is a nop for boot2.  It just checks the MAGIC part of the field,
ignoring the MID.  boot2 is the only thing that loads this file, and
only on x86 so the MID_i386 is always the right value (the rest of the
code is already x86 specific).

Reviewed by:	bde@, jhb@
MFC after:	8.0 is out the door :)
2009-09-10 00:47:32 +00:00
Doug Rabson
8948542c2d Allow for a zero length 'loader'. 2008-04-05 10:26:20 +00:00
Xin LI
50385af97a An old patch from Dan Lukes <dan at obluda.cz>:
+ Include netinet/in.h for ntohl()
 * Since the return value was tested separately, cast the values to
   size_t in order to shut up compiler warnings.
 + Raise WARNS= level to 6

PR:	bin/71666
2006-01-23 13:55:32 +00:00
Ruslan Ermilov
093f1218bc Fix the same problem that was fixed in rev. 1.6 and got reintroduced
in rev. 1.8 -- make btxld(8) a cross-tool for i386 and now amd64.

Tested on:	alpha (which has a different idea of __LDPGSZ)
2005-02-19 21:32:21 +00:00
David E. O'Brien
49a3940873 Adjust the system endian and a.out headers to be more MI and cross-building
friendly.  Use the systems headers rather than local versions.

Reviewed by:	ru
2004-06-22 17:05:39 +00:00
Ruslan Ermilov
7148ee891c Make this work on different endianness machines.
Tested on:	sparc64

: FreeBSD/i386 bootstrap loader, Revision 1.1
: (ru@panther.freebsd.org, Tue Mar 11 05:31:14 PST 2003)
: Loading /boot/defaults/loader.conf
2003-03-11 13:48:58 +00:00
Ruslan Ermilov
3bf31777b9 Added MI version of <sys/imgact_aout.h>, "a.out.h", which is
always compatible with the i386 version.

This fixes one of the problems I had cross-releasing i386 on
Alpha: the produced "-f aout" binaries are now identical.
2003-02-04 18:56:34 +00:00
Mike Barcroft
ac53b225bb Get howmany() macro from <sys/param.h>, instead of depending on its
existence in <sys/types.h>.
2002-09-24 22:30:56 +00:00
Marcel Moolenaar
b0ca5f031d o Allow btxld to be compiled on 64-bit machines
o  s/unsigned/unsigned int/g
o  Add -Wall

btxld can now be built as a cross-tool for cross-building i386/pc98 on
platforms that don't have btxld (such as alpha).
2000-01-04 14:10:36 +00:00
Peter Wemm
97d92980a9 $Id$ -> $FreeBSD$ 1999-08-28 01:35:59 +00:00
Robert Nordier
38c931abc7 Enable client entry point support. 1998-09-13 13:28:07 +00:00
Robert Nordier
9c9f4492f8 btxld is a link editor for BTX (boot extender) clients, supporting ELF,
a.out, and binary formats.
1998-09-12 06:49:48 +00:00