Commit 78438b36 authored by Scott Wood's avatar Scott Wood Committed by Paul Mackerras

[POWERPC] bootwrapper: Preserve the pp pointer in ft_make_space() when calling ft_reorder().

The ft_reorder() function may change the start of the region of interest,
so the pointer provided by the caller into that region must be fixed up
to still point to the same datum.
Signed-off-by: default avatarScott Wood <scottwood@freescale.com>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent c8aa7263
......@@ -261,8 +261,14 @@ static int ft_make_space(struct ft_cxt *cxt, char **pp, enum ft_rgn_id rgn,
char *str, *next;
enum ft_rgn_id r;
if (!cxt->isordered && !ft_reorder(cxt, nextra))
if (!cxt->isordered) {
unsigned long rgn_off = *pp - cxt->rgn[rgn].start;
if (!ft_reorder(cxt, nextra))
return 0;
*pp = cxt->rgn[rgn].start + rgn_off;
}
if (ft_shuffle(cxt, pp, rgn, nextra))
return 1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment