This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Fix dynamic linker issue with bind-now
- From: Andreas Schwab <schwab at linux-m68k dot org>
- To: "Petar Jovanovic" <petar dot jovanovic at rt-rk dot com>
- Cc: "'Will Newton'" <will dot newton at linaro dot org>, "'Mike Frysinger'" <vapier at gentoo dot org>, "'libc-alpha'" <libc-alpha at sourceware dot org>, <petar dot jovanovic at imgtec dot com>, "'David Miller'" <davem at davemloft dot net>
- Date: Sat, 06 Dec 2014 10:38:13 +0100
- Subject: Re: [PATCH] Fix dynamic linker issue with bind-now
- Authentication-results: sourceware.org; auth=none
- References: <1408493406-86741-1-git-send-email-petar dot jovanovic at rt-rk dot com> <1408493406-86741-2-git-send-email-petar dot jovanovic at rt-rk dot com> <000a01cfe8dd$488fbdf0$d9af39d0$ at rt-rk dot com> <20141021213320 dot GA25185 at vapier> <000301d00e87$8284f5f0$878ee1d0$ at rt-rk dot com> <CANu=DmjNC0iFRcHiifhgb0x5ot1t1gCOEktKpq9irt+j_A-5_Q at mail dot gmail dot com> <002a01d010ee$3115af70$93410e50$ at rt-rk dot com>
"Petar Jovanovic" <petar.jovanovic@rt-rk.com> writes:
> diff --git a/elf/dynamic-link.h b/elf/dynamic-link.h
> index 7b3e295..d5dea8e 100644
> --- a/elf/dynamic-link.h
> +++ b/elf/dynamic-link.h
> @@ -133,7 +133,9 @@ elf_machine_lazy_rel (struct link_map *map,
> \
> if (ranges[0].start + ranges[0].size == (start + size)) \
> ranges[0].size -= size; \
> - if (! ELF_DURING_STARTUP && ((do_lazy) || ranges[0].size == 0)) \
> + if (! ELF_DURING_STARTUP \
> + && ((do_lazy) || ranges[0].size == 0 || \
> + ranges[0].start + ranges[0].size != start)) \
Line break before the operator, not after; tabify indentation.
> diff --git a/elf/tst-split-dynreloc.c b/elf/tst-split-dynreloc.c
> new file mode 100644
> index 0000000..32d474f
> --- /dev/null
> +++ b/elf/tst-split-dynreloc.c
> @@ -0,0 +1,27 @@
> +#include <stdio.h>
> +
> +static int __attribute__((section(".bar"))) bar = 0x12345678;
Space before paren.
> +/*
> + * This test will be used to create an executable with a specific
> + * section layout in which .rela.dyn and .rela.plt are not contiguous.
> + *
> + * For x86 case, readelf will report something like:
> + *
> + * ...
> + * [10] .rela.dyn RELA
> + * [11] .bar PROGBITS
> + * [12] .rela.plt RELA
> + * ...
> + *
> + * This is important as this case was not correctly handled by dynamic
> + * linker in the bind-now case, and the second section was never
> + * processed.
> + */
Remove the asterisk column.
> +int main() {
> + printf("%s\n", foo);
> + return 0;
> +}
Braces on new line, line break after return type, space before paren,
missing prototype.
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."