Skip to content
mcc is a machine code compiler.
Branch: master
Clone or download
esote Fix incorrect evaluation of memsize with large values
If the lower 32 bits of memsize were zero but not the upper 32 bits, the bss
program header and shstrtab label would not be written.
Latest commit 4129631 Jun 7, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
LICENSE machine code compiler May 16, 2019
Makefile Produce both 32 and 64-bit executables May 18, 2019
README
hello_i386.mcc Produce both 32 and 64-bit executables May 18, 2019
hello_x86_64.mcc
mcc.1
mcc.c Fix incorrect evaluation of memsize with large values Jun 7, 2019
mcc.h Produce both 32 and 64-bit executables May 18, 2019
write.h Produce both 32 and 64-bit executables May 18, 2019
write_32.c Remove bss section if memsize is zero May 18, 2019
write_64.c Remove bss section if memsize is zero May 18, 2019

README

NAME
	mcc - machine code compiler

SYNOPSIS
	mcc [-3s] [-m memsize] [-o file] file

DESCRIPTION
	mcc is a machine code compiler. It reads ASCII text '0' and '1' mapping
	to machine code instructions. All other characters are ignored except
	the comment token ';'. Comments begin with ';' and continue until EOL.

	Use the -o option to specify the output filename. The default is to put
	the executable in a.out.

	Supports little-endian x86-64 and i386 execution environments using the
	System V application binary interface. 64-bit is the default mode,
	32-bit mode is specified with the -3 option.

	When writing to the .bss section, specify the size of memory reserved
	using the -m option. If the size is zero (default), no .bss section will
	be written for the executable.

	In 64-bit mode the .bss and .text sections start at 0x402000 and
	0x401000 respectively, and in 32-bit mode 0x804a000 and 0x8049000
	respectively. Program header segment alignment is set to 0x1000 (the
	page size on most systems).

	.bss is aligned to a 16-byte constraint and .text to an 8-byte
	constraint.

	Use the -s option to mark the .text section as writable, allowing
	self-modifying code.

AUTHORS
	mcc was written by Esote.

COPYRIGHT
	Copyright (c) 2019 Esote. There is NO warranty. You may redistribute
	this software under the terms of the GNU Affero General Public License.
	For more information, see the LICENSE file.
You can’t perform that action at this time.