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: "Petar Jovanovic" <petar dot jovanovic at rt-rk dot com>
- To: "'Andreas Schwab'" <schwab at linux-m68k dot org>
- 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: Tue, 6 Jan 2015 02:13:36 +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> <m2fvct6rui dot fsf at linux-m68k dot org>
ping.
-----Original Message-----
From: Petar Jovanovic [mailto:petar.jovanovic@rt-rk.com]
Sent: Wednesday, December 17, 2014 12:26 AM
To: 'Andreas Schwab'
Cc: 'Will Newton'; 'Mike Frysinger'; 'libc-alpha';
'petar.jovanovic@imgtec.com'; 'David Miller'
Subject: RE: [PATCH] Fix dynamic linker issue with bind-now
ping.
-----Original Message-----
From: Petar Jovanovic [mailto:petar.jovanovic@rt-rk.com]
Sent: Sunday, December 7, 2014 2:04 AM
To: 'Andreas Schwab'
Cc: 'Will Newton'; 'Mike Frysinger'; 'libc-alpha';
'petar.jovanovic@imgtec.com'; 'David Miller'
Subject: RE: [PATCH] Fix dynamic linker issue with bind-now
Hi Andreas,
Thanks for the comments.
> Line break before the operator, not after; tabify indentation.
Done.
> Space before paren.
Done.
>Remove the asterisk column.
Done.
> Braces on new line, line break after return type, space before paren,
missing prototype.
Done, done, done. What is missing a prototype? Printf? If so, that should be
already present in <stdio.h>
I am attaching 3rd updated version of the patch.
Regards,
Petar
-----Original Message-----
From: Andreas Schwab [mailto:schwab@linux-m68k.org]
Sent: Saturday, December 6, 2014 10:38 AM
To: Petar Jovanovic
Cc: 'Will Newton'; 'Mike Frysinger'; 'libc-alpha';
petar.jovanovic@imgtec.com; 'David Miller'
Subject: Re: [PATCH] Fix dynamic linker issue with bind-now
"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."