Added support for --large-alignment in ld65.
Implemented the same way as in ca65.
This commit is contained in:
committed by
greg-king5
parent
5b56c6e3a2
commit
ad1eadd60d
@@ -52,8 +52,10 @@ unsigned ModuleId = 0; /* Id for o65 module */
|
||||
unsigned char HaveStartAddr = 0; /* Start address not given */
|
||||
unsigned long StartAddr = 0x200; /* Start address */
|
||||
|
||||
unsigned char VerboseMap = 0; /* Verbose map file */
|
||||
unsigned char AllowMultDef = 0; /* Allow multiple definitions */
|
||||
unsigned char VerboseMap = 0; /* Verbose map file */
|
||||
unsigned char AllowMultDef = 0; /* Allow multiple definitions */
|
||||
unsigned char LargeAlignment = 0; /* Don't warn about large alignments */
|
||||
|
||||
const char* MapFileName = 0; /* Name of the map file */
|
||||
const char* LabelFileName = 0; /* Name of the label file */
|
||||
const char* DbgFileName = 0; /* Name of the debug file */
|
||||
|
||||
@@ -54,6 +54,8 @@ extern unsigned long StartAddr; /* Start address */
|
||||
|
||||
extern unsigned char VerboseMap; /* Verbose map file */
|
||||
extern unsigned char AllowMultDef; /* Allow multiple definitions */
|
||||
extern unsigned char LargeAlignment; /* Don't warn about large alignments */
|
||||
|
||||
extern const char* MapFileName; /* Name of the map file */
|
||||
extern const char* LabelFileName; /* Name of the label file */
|
||||
extern const char* DbgFileName; /* Name of the debug file */
|
||||
|
||||
@@ -136,6 +136,7 @@ static void Usage (void)
|
||||
" --end-group\t\t\tEnd a library group\n"
|
||||
" --force-import sym\t\tForce an import of symbol 'sym'\n"
|
||||
" --help\t\t\tHelp (this text)\n"
|
||||
" --large-alignment\t\tDon't warn about large alignments\n"
|
||||
" --lib file\t\t\tLink this library\n"
|
||||
" --lib-path path\t\tSpecify a library search path\n"
|
||||
" --mapfile name\t\tCreate a map file\n"
|
||||
@@ -406,6 +407,14 @@ static void OptHelp (const char* Opt attribute ((unused)),
|
||||
|
||||
|
||||
|
||||
static void OptLargeAlignment (const char* Opt attribute ((unused)),
|
||||
const char* Arg attribute ((unused)))
|
||||
/* Don't warn about large alignments */
|
||||
{
|
||||
LargeAlignment = 1;
|
||||
}
|
||||
|
||||
|
||||
static void OptLib (const char* Opt attribute ((unused)), const char* Arg)
|
||||
/* Link a library */
|
||||
{
|
||||
@@ -617,6 +626,7 @@ static void ParseCommandLine(void)
|
||||
{ "--end-group", 0, CmdlOptEndGroup },
|
||||
{ "--force-import", 1, OptForceImport },
|
||||
{ "--help", 0, OptHelp },
|
||||
{ "--large-alignment", 0, OptLargeAlignment },
|
||||
{ "--lib", 1, OptLib },
|
||||
{ "--lib-path", 1, OptLibPath },
|
||||
{ "--mapfile", 1, OptMapFile },
|
||||
|
||||
@@ -230,7 +230,7 @@ Section* ReadSection (FILE* F, ObjData* O)
|
||||
"%lu. Last module requiring alignment was '%s'.",
|
||||
GetString (Name), Alignment, MAX_ALIGNMENT,
|
||||
GetObjFileName (O));
|
||||
} else if (Alignment >= LARGE_ALIGNMENT) {
|
||||
} else if (Alignment >= LARGE_ALIGNMENT && !LargeAlignment) {
|
||||
Warning ("Combined alignment for segment '%s' is suspiciously "
|
||||
"large (%lu). Last module requiring alignment was '%s'.",
|
||||
GetString (Name), Alignment, GetObjFileName (O));
|
||||
|
||||
Reference in New Issue
Block a user