[RFC v3 PATCH 1/4] Extract list of relocation offsets

Paul Mackerras paulus at samba.org
Tue Jul 22 16:29:35 EST 2008


Mohan Kumar M writes:

> diff --git a/arch/powerpc/boot/relocs.c b/arch/powerpc/boot/relocs.c
> new file mode 100644
> index 0000000..31ca903

Where did this file come from?  Did you write it all yourself?  If
not, then you need to credit the original author in the patch
description at least.  Also it needs a copyright notice.

There is some evidence that this has been copied from a similar
program for x86.  For instance, this:

+/*
+ * Following symbols have been audited. There values are constant and do
+ * not change if bzImage is loaded at a different physical address than
+ * the address for which it has been compiled. Don't warn user about
+ * absolute relocations present w.r.t these symbols.
+ */
+static const char* safe_abs_relocs[] = {
+		"__kernel_vsyscall",
+		"__kernel_rt_sigreturn",
+		"__kernel_sigreturn",
+		"SYSENTER_RETURN",
+};

refers to symbols that don't exist on powerpc but (presumably) do on
x86.

Also, this:

+		if (shdr[i].sh_type == SHT_REL) {
+			reltab[i] = malloc(shdr[i].sh_size);
+			if (!reltab[i]) {
+				die("malloc of %d bytes for relocs failed\n",
+					shdr[i].sh_size);
+			}
+			relp = reltab[i];

is, I think, unnecessary, since as far as I know we never get SHT_REL
sections on powerpc.

Paul.



More information about the Linuxppc-dev mailing list