Skip to content

Commit

Permalink
[PATCH] ppc32: Kill embedded system.map, use kallsyms
Browse files Browse the repository at this point in the history
This patch kills the whole embedded System.map mecanism and the
bootloader-passed System.map that was used to provide symbol resolution in
xmon.  Instead, xmon now uses kallsyms like ppc64 does.

No hurry getting that in Linus tree, let it be tested in -mm for a while
first and make sure it doesn't break various embedded configs.

Signed-off-by: Benjamin Herrenschmidt <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
ozbenh authored and Linus Torvalds committed Jun 22, 2005
1 parent a70d439 commit 6879dc1
Show file tree
Hide file tree
Showing 9 changed files with 84 additions and 432 deletions.
3 changes: 0 additions & 3 deletions arch/ppc/boot/ld.script
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,6 @@ SECTIONS
*(.ramdisk)
__ramdisk_end = .;
. = ALIGN(4096);
__sysmap_begin = .;
*(.sysmap)
__sysmap_end = .;
CONSTRUCTORS
}
_edata = .;
Expand Down
5 changes: 1 addition & 4 deletions arch/ppc/boot/openfirmware/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,10 @@ $(images)/ramdisk.image.gz:
@echo ' RAM disk image must be provided separately'
@/bin/false

objcpxmon-$(CONFIG_XMON) := --add-section=.sysmap=System.map \
--set-section-flags=.sysmap=contents,alloc,load,readonly,data
quiet_cmd_genimage = GEN $@
cmd_genimage = $(OBJCOPY) -R .comment \
--add-section=.image=$(images)/vmlinux.gz \
--set-section-flags=.image=contents,alloc,load,readonly,data \
$(objcpxmon-y) $< $@
--set-section-flags=.image=contents,alloc,load,readonly,data $< $@

targets += image.o
$(obj)/image.o: $(obj)/dummy.o $(images)/vmlinux.gz FORCE
Expand Down
16 changes: 0 additions & 16 deletions arch/ppc/boot/openfirmware/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#include <asm/page.h>

/* Information from the linker */
extern char __sysmap_begin, __sysmap_end;

extern int strcmp(const char *s1, const char *s2);
extern char *avail_ram, *avail_high;
Expand Down Expand Up @@ -116,14 +115,8 @@ void gunzip(void *dst, int dstlen, unsigned char *src, int *lenp)
void make_bi_recs(unsigned long addr, char *name, unsigned int mach,
unsigned long progend)
{
unsigned long sysmap_size;
struct bi_record *rec;

/* Figure out the size of a possible System.map we're going to
* pass along.
* */
sysmap_size = (unsigned long)(&__sysmap_end) -
(unsigned long)(&__sysmap_begin);

/* leave a 1MB gap then align to the next 1MB boundary */
addr = _ALIGN(addr+ (1<<20) - 1, (1<<20));
Expand All @@ -147,15 +140,6 @@ void make_bi_recs(unsigned long addr, char *name, unsigned int mach,
rec->size = sizeof(struct bi_record) + 2 * sizeof(unsigned long);
rec = (struct bi_record *)((unsigned long)rec + rec->size);

if (sysmap_size) {
rec->tag = BI_SYSMAP;
rec->data[0] = (unsigned long)(&__sysmap_begin);
rec->data[1] = sysmap_size;
rec->size = sizeof(struct bi_record) + 2 *
sizeof(unsigned long);
rec = (struct bi_record *)((unsigned long)rec + rec->size);
}

rec->tag = BI_LAST;
rec->size = sizeof(struct bi_record);
rec = (struct bi_record *)((unsigned long)rec + rec->size);
Expand Down
4 changes: 2 additions & 2 deletions arch/ppc/boot/simple/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ $(obj)/zvmlinux: $(OBJS) $(LIBS) $(srctree)/$(boot)/ld.script \
$(obj)/dummy.o $(obj)/image.o
$(LD) $(LD_ARGS) -o $@ $(OBJS) $(obj)/image.o $(LIBS)
$(OBJCOPY) $(OBJCOPY_ARGS) $@ $@ -R .comment -R .stab \
-R .stabstr -R .ramdisk -R .sysmap
-R .stabstr -R .ramdisk

$(obj)/zvmlinux.initrd: $(OBJS) $(LIBS) $(srctree)/$(boot)/ld.script \
$(images)/vmlinux.gz $(obj)/dummy.o
Expand All @@ -215,7 +215,7 @@ $(obj)/zvmlinux.initrd: $(OBJS) $(LIBS) $(srctree)/$(boot)/ld.script \
$(obj)/dummy.o $(obj)/image.o
$(LD) $(LD_ARGS) -o $@ $(OBJS) $(obj)/image.o $(LIBS)
$(OBJCOPY) $(OBJCOPY_ARGS) $@ $@ -R .comment -R .stab \
-R .stabstr -R .sysmap
-R .stabstr

# Sort-of dummy rules, that let us format the image we want.
zImage: $(images)/$(zimage-y) $(obj)/zvmlinux
Expand Down
186 changes: 0 additions & 186 deletions arch/ppc/boot/utils/addSystemMap.c

This file was deleted.

7 changes: 0 additions & 7 deletions arch/ppc/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,6 @@ extern void power4_idle(void);

extern boot_infos_t *boot_infos;
struct ide_machdep_calls ppc_ide_md;
char *sysmap;
unsigned long sysmap_size;

/* Used with the BI_MEMSIZE bootinfo parameter to store the memory
size value reported by the boot loader. */
Expand Down Expand Up @@ -578,11 +576,6 @@ void parse_bootinfo(struct bi_record *rec)
case BI_CMD_LINE:
strlcpy(cmd_line, (void *)data, sizeof(cmd_line));
break;
case BI_SYSMAP:
sysmap = (char *)((data[0] >= (KERNELBASE)) ? data[0] :
(data[0]+KERNELBASE));
sysmap_size = data[1];
break;
#ifdef CONFIG_BLK_DEV_INITRD
case BI_INITRD:
initrd_start = data[0] + KERNELBASE;
Expand Down
16 changes: 1 addition & 15 deletions arch/ppc/mm/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,6 @@ extern struct task_struct *current_set[NR_CPUS];
char *klimit = _end;
struct mem_pieces phys_avail;

extern char *sysmap;
extern unsigned long sysmap_size;

/*
* this tells the system to map all of ram with the segregs
* (i.e. page tables) instead of the bats.
Expand Down Expand Up @@ -442,12 +439,6 @@ void __init mem_init(void)
if (agp_special_page)
SetPageReserved(virt_to_page(agp_special_page));
#endif
if ( sysmap )
for (addr = (unsigned long)sysmap;
addr < PAGE_ALIGN((unsigned long)sysmap+sysmap_size) ;
addr += PAGE_SIZE)
SetPageReserved(virt_to_page(addr));

for (addr = PAGE_OFFSET; addr < (unsigned long)high_memory;
addr += PAGE_SIZE) {
if (!PageReserved(virt_to_page(addr)))
Expand Down Expand Up @@ -482,9 +473,7 @@ void __init mem_init(void)
codepages<< (PAGE_SHIFT-10), datapages<< (PAGE_SHIFT-10),
initpages<< (PAGE_SHIFT-10),
(unsigned long) (totalhigh_pages << (PAGE_SHIFT-10)));
if (sysmap)
printk("System.map loaded at 0x%08x for debugger, size: %ld bytes\n",
(unsigned int)sysmap, sysmap_size);

#ifdef CONFIG_PPC_PMAC
if (agp_special_page)
printk(KERN_INFO "AGP special page: 0x%08lx\n", agp_special_page);
Expand Down Expand Up @@ -534,9 +523,6 @@ set_phys_avail(unsigned long total_memory)
if (rtas_data)
mem_pieces_remove(&phys_avail, rtas_data, rtas_size, 1);
#endif
/* remove the sysmap pages from the available memory */
if (sysmap)
mem_pieces_remove(&phys_avail, __pa(sysmap), sysmap_size, 1);
#ifdef CONFIG_PPC_PMAC
/* Because of some uninorth weirdness, we need a page of
* memory as high as possible (it must be outside of the
Expand Down
Loading

0 comments on commit 6879dc1

Please sign in to comment.