|
From: Julian S. <js...@ac...> - 2005-06-20 09:20:33
|
> Make the stage2.lds building platform-independent by not trying to match
> an exact address (idea from Paul Mackerras' PPC port). Thus it could be
> moved into coregrind/Makefile.am.
>
> Let me know if this breaks anything on other platforms.
Yeh, there's a problem. This is what's causing 100% borkage on
RH73 and I suspect also RH9. The linker script isn't getting
mangled properly, so stage2 is getting linked for the default
address of 0x8048000, so it's hosed.
On a platform where it does work right (SuSE 9.1), the default linker
script has
PROVIDE (__executable_start = 0x08048000); . = 0x08048000 + SIZEOF_HEADERS;
which gets transmuted into
PROVIDE (__executable_start = kickstart_base); . = kickstart_base +
SIZEOF_HEADERS;
presumably by this
stage2.lds: Makefile
$(CC) -Wl,--verbose -nostdlib 2>&1 | sed \
-e '1,/^=====\+$$/d' \
-e '/^=====\+$$/d' \
-e '/executable_start/s/0x[0-9A-Fa-f]\+/kickstart_base/g' > $@
\
|| rm -f $@
I can see that the third "-e" substitutes out the first 0x08048000,
but I don't see how the second one is substituted. Does the -e thing
find a line containing "executable_start" and then do the given
substitution on the rest of the line, as many times as necessary?
On a platform where it fails (RH73) the default script has this
. = 0x08048000 + SIZEOF_HEADERS;
and it is unchanged in the post-sed-ified result.
I must say I'm not convinced by this change. It seems overly
fragile. How it was before, the entry address (0x8048000 / whatever)
would be changed to 'kickstart_base' regardless of the surrounding
context, which sounds like the Right Thing To Do; whereas now we're
context dependent.
Suggestions?
J
|