Correctly create the PPC bootstrap section

To be copied to the flat binary file from the ELF file, the section
.bootstrap needs to have the "load" flag. Otherwise objcopy removes it
(even with -j .bootstrap).

Signed-off-by: Laurent Vivier <laurent@vivier.eu>
This commit is contained in:
Laurent Vivier 2009-06-12 00:59:26 +02:00
parent c1b482e48a
commit 5f819dde88

View File

@ -151,31 +151,32 @@ bootstrap: bootstrapPPC.o
$(PPC_OBJCOPY) -j .text -j .data -j .rodata \
-O binary bootstrapPPC.o bootstrap
switch_to_PPC.o: switch_to_PPC.S bootstrap
$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $^
$(OBJCOPY) --add-section .bootstrap=bootstrap \
--set-section-flags .bootstrap=contents,alloc,load,data \
switch_to_PPC.o
apple_driver: apple_driver.o
$(OBJCOPY) -j .text -j .data -j .rodata -j .got -j .bootstrap \
-O binary apple_driver.o apple_driver
second: second.o
$(OBJCOPY) -j .text -j .data -j .rodata -j .got -j .bootstrap \
$(OBJCOPY) -j .text -j .data -j .rodata -j .got -j .bootstrap \
-O binary second.o second
second.o: $(OBJS) bootstrap $(TOP)/ld.script
$(OBJCOPY) -R .bootstrap switch_to_PPC.o
$(OBJCOPY) --add-section .bootstrap=bootstrap switch_to_PPC.o
$(LD) -T $(TOP)/ld.script -o second.o $(OBJS) $(LIBS)
else
apple_driver: apple_driver.o
$(OBJCOPY) -j .text -j .data -j .rodata -j .got \
-O binary apple_driver.o apple_driver
second: second.o
$(OBJCOPY) -j .text -j .data -j .rodata -j .got \
-O binary second.o second
endif
second.o: $(OBJS) $(TOP)/ld.script
$(LD) -T $(TOP)/ld.script -o second.o $(OBJS) $(LIBS)
apple_driver: apple_driver.o
$(OBJCOPY) -j .text -j .data -j .rodata -j .got \
-O binary apple_driver.o apple_driver
apple_driver.o: $(OBJS) $(TOP)/ld.script
$(LD) -T $(TOP)/ld.script -o apple_driver.o $(OBJS) $(LIBS)
endif
.c.o:
$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $^