1
0
mirror of https://github.com/cc65/cc65.git synced 2024-06-17 00:29:31 +00:00

Added support for --large-alignment in ld65.

Implemented the same way as in ca65.
This commit is contained in:
Chris Cacciatore 2020-05-08 15:33:30 -07:00 committed by greg-king5
parent 5b56c6e3a2
commit ad1eadd60d
5 changed files with 24 additions and 3 deletions

View File

@ -79,6 +79,7 @@ Long options:
--end-group End a library group
--force-import sym Force an import of symbol 'sym'
--help Help (this text)
--large-alignment Don't warn about large alignments
--lib file Link this library
--lib-path path Specify a library search path
--mapfile name Create a map file
@ -298,6 +299,12 @@ Here is a description of all of the command-line options:
information generation is currently being developed, so the format of the
file and its contents are subject to change without further notice.
<label id="option--large-alignment">
<tag><tt>--large-alignment</tt></tag>
Disable warnings about a large combined alignment. See the discussion of the
<tt><ref id=".ALIGN" name=".ALIGN"></tt> directive for futher information.
<tag><tt>--lib file</tt></tag>

View File

@ -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 */

View 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 */

View 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 },

View File

@ -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));