LZMA rom_stream.o code too large when compiled with GCC 4.1.0

Marcelo Tosatti mtosatti at redhat.com
Fri Sep 22 00:43:59 EDT 2006


Hi folks,

While trying to build the newest version of buildrom GIT on my FC5 laptop
I've got:

gcc -m32 -nostdlib -nostartfiles -static -o linuxbios -T ldscript.ld crt0.o
/usr/bin/ld: section .id [ffffffd9 -> ffffffef] overlaps section .rom [fffff1a8 -> ffffffdf]
/usr/bin/ld: linuxbios: section .id lma 0xffffffd9 overlaps previous sections
/usr/bin/ld: linuxbios: section .reset lma 0xfffffff0 overlaps previous sectionscollect2: ld returned 1 exit status
make[2]: *** [linuxbios] Error 1

I noticed that rom_stream.o for LZMA is twice as large, causing the section overlap.

-rom_stream.o: 2188
+rom_stream.o: 4972

Switching the compiler optimization option from -Os to -O0 (no optimization) shrinks rom_stream.o
size, making it fit appropriately.

--- Makefile.orig	2006-09-22 01:32:23.000000000 -0300
+++ Makefile	2006-09-22 01:35:50.000000000 -0300
@@ -17,8 +17,8 @@
  LIBGCC_FILE_NAME := $(shell $(CC) -print-libgcc-file-name)
  GCC_INC_DIR := $(shell $(CC) -print-search-dirs | sed -ne "s/install: \(.*\)/\1include/gp")
  CPPFLAGS := -I$(TOP)/src/include -I$(TOP)/src/arch/$(ARCH)/include -I$(GCC_INC_DIR) $(CPUFLAGS)
- CFLAGS := $(CPU_OPT) $(CPPFLAGS) -Os -nostdinc -nostdlib -fno-builtin  -Wall
- HOSTCFLAGS:= -Os -Wall
+ CFLAGS := $(CPU_OPT) $(CPPFLAGS) -O0 -nostdinc -nostdlib -fno-builtin  -Wall
+ HOSTCFLAGS:= -O0 -Wall
  LINUXBIOS_RAM-$(CONFIG_COMPRESS):=linuxbios_ram.nrv2b
  LINUXBIOS_RAM-$(CONFIG_UNCOMPRESSED):=linuxbios_ram.bin
  .PHONY : crt0.s

After that workaround I get http://dev.laptop.org/ticket/120, reported
by dilinger, which seems to be a separate problem.

Carl, I suspect we should either shrink the LZMA code (best option) or
use less aggressive compiler optimizations. Can you please look into the
details of this?

gcc version 4.1.0 20060304 (Red Hat 4.1.0-3)

Thanks




More information about the Devel mailing list