Commit eb9d18a4 authored by Alessandro Rubini's avatar Alessandro Rubini

Makefile: use bigobj.lds during initial partial link

This commit makes no effect, but it prepares for the following one.
In general, using an intermediate platform-agnostic linker script
when making wrc.o is not bad, so let's do it here.

The main reason why we need it is to force the "KEEP" command for the
".cmd" ELF section, introduced by the next commit.  The alternative to
this would be chaning the main linker script, which is worse in my
opinion.

If we add initcalls or similar stuff later, this bigobj.lds is the
place to do it.
Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent 2503afe9
......@@ -127,7 +127,7 @@ $(OUTPUT).elf: $(LDS) $(AUTOCONF) gitmodules $(OUTPUT).o
$(SIZE) $@
$(OUTPUT).o: $(OBJS)
$(LD) --gc-sections -e _start -r $(OBJS) -o $@
$(LD) --gc-sections -e _start -r $(OBJS) -T bigobj.lds -o $@
%.bin: %.elf
${OBJCOPY} -O binary $^ $@
......
/*
* This is used to generate wrc.o from all objects. We need to use
* --gc-sections because sockitowm include a lot of stuff we don't run,
* but at the same time we need to preserve all commands. So use KEEP()
*/
SECTIONS
{
.cmd : {
__cmd_begin = .;
KEEP(*(.cmd))
__cmd_end = .;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment