On ARM, it seems first = "true" parsing doesn't actually work in .rbuild files -- the object is not properly placed in the beginning of the FreeLDR text section.

As a workaround, a special "startup" section is now used to contain the boot.s code, and a linker flag is used to set this section as the entrypoint section at 0x8000.
FreeLDR for ARM now links properly, with _start at 0x8000.


svn path=/trunk/; revision=32136
This commit is contained in:
ReactOS Portable Systems Group 2008-02-05 11:15:59 +00:00
parent b9ad8e61be
commit 8a8e8285a9

View file

@ -3546,12 +3546,24 @@ MingwBootLoaderModuleHandler::GenerateBootLoaderModuleTarget ()
fprintf ( fMakefile, "\t$(ECHO_LD)\n" );
fprintf ( fMakefile,
"\t${gcc} -Wl,--subsystem,native -Wl,-Ttext,0x8000 -o %s %s %s %s\n",
backend->GetFullName ( junk_tmp ).c_str (),
objectsMacro.c_str (),
linkDepsMacro.c_str (),
GetLinkerMacro ().c_str ());
if (Environment::GetArch() == "arm")
{
fprintf ( fMakefile,
"\t${gcc} -Wl,--subsystem,native -Wl,--section-start,startup=0x8000 -o %s %s %s %s\n",
backend->GetFullName ( junk_tmp ).c_str (),
objectsMacro.c_str (),
linkDepsMacro.c_str (),
GetLinkerMacro ().c_str ());
}
else
{
fprintf ( fMakefile,
"\t${gcc} -Wl,--subsystem,native -Wl,-Ttext,0x8000 -o %s %s %s %s\n",
backend->GetFullName ( junk_tmp ).c_str (),
objectsMacro.c_str (),
linkDepsMacro.c_str (),
GetLinkerMacro ().c_str ());
}
fprintf ( fMakefile,
"\t${objcopy} -O binary %s $@\n",
backend->GetFullName ( junk_tmp ).c_str () );