0
0
mirror of https://github.com/netwide-assembler/nasm.git synced 2025-09-22 10:43:39 -04:00

Remove the --allow-64-bits option and make it a warning

Remove the --allow-64-bits relocation, and instead make it a
suppressible warning in the case of a zero-extended relocation, and an
error in the case of a sign-extended relocation.

Relocations which can be losslessly represented in the output format
do not issue any diagnostic at all, as there is no problem in that
case.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
This commit is contained in:
H. Peter Anvin
2016-02-08 10:32:13 -08:00
parent 0c11e123b2
commit d24dd5fecc
5 changed files with 29 additions and 29 deletions

14
nasm.c
View File

@@ -88,7 +88,6 @@ static int using_debug_info, opt_verbose_info;
bool tasm_compatible_mode = false;
int pass0, passn;
int maxbits = 0;
static bool allow_64_bit = false;
int globalrel = 0;
int globalbnd = 0;
@@ -169,6 +168,7 @@ static const struct warning {
{"lock", "lock prefix on unlockable instructions", true},
{"hle", "invalid hle prefixes", true},
{"bnd", "invalid bnd prefixes", true},
{"zero-reloc", "relocation zero-extended to match output format", true},
};
static bool want_usage;
@@ -618,12 +618,10 @@ struct textargs {
enum text_options {
OPT_PREFIX,
OPT_POSTFIX,
OPT_ALLOW_64_BIT
};
struct textargs textopts[] = {
{"prefix", OPT_PREFIX},
{"postfix", OPT_POSTFIX},
{"allow-64-bit", OPT_ALLOW_64_BIT},
{NULL, 0}
};
@@ -981,9 +979,7 @@ set_warning:
}
break;
}
case OPT_ALLOW_64_BIT:
allow_64_bit = true;
break;
default:
{
nasm_error(ERR_NONFATAL | ERR_NOFILE | ERR_USAGE,
@@ -2101,12 +2097,6 @@ static int get_bits(char *value)
"cannot specify 64-bit segment on processor below an x86-64");
i = 16;
}
if (i != maxbits && !allow_64_bit) {
nasm_error(ERR_NONFATAL,
"%s output format does not support 64-bit code",
ofmt->shortname);
i = 16;
}
} else {
nasm_error(pass0 < 2 ? ERR_NONFATAL : ERR_FATAL,
"`%s' is not a valid segment size; must be 16, 32 or 64",