rules.mk: Add cross-reference to the map file

This adds a section to the bottom of the .map file containing the
symbol->object file mapping.  (the logical inverse of the existing
section at the start of the .map file that lists objects, and the
symbols that pulled them in)

Reviewed-by: Karl Palsson <karlp@tweak.net.au>
This commit is contained in:
Paul Fertser
2017-12-18 11:33:33 +03:00
committed by Karl Palsson
parent 6dbc067b3e
commit f4e129cd4a

View File

@@ -126,7 +126,7 @@ TGT_CPPFLAGS += $(DEFS)
TGT_LDFLAGS += --static -nostartfiles TGT_LDFLAGS += --static -nostartfiles
TGT_LDFLAGS += -T$(LDSCRIPT) TGT_LDFLAGS += -T$(LDSCRIPT)
TGT_LDFLAGS += $(ARCH_FLAGS) $(DEBUG) TGT_LDFLAGS += $(ARCH_FLAGS) $(DEBUG)
TGT_LDFLAGS += -Wl,-Map=$(*).map TGT_LDFLAGS += -Wl,-Map=$(*).map -Wl,--cref
TGT_LDFLAGS += -Wl,--gc-sections TGT_LDFLAGS += -Wl,--gc-sections
ifeq ($(V),99) ifeq ($(V),99)
TGT_LDFLAGS += -Wl,--print-gc-sections TGT_LDFLAGS += -Wl,--print-gc-sections