This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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."


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]