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 1/2] elf: Accept absolute (SHN_ABS) symbols whose value is zero [BZ #23307]


* Maciej W. Rozycki:

> --- glibc.orig/elf/dl-lookup.c	2018-06-17 09:06:30.202407070 +0100
> +++ glibc/elf/dl-lookup.c	2018-06-18 18:12:36.138114433 +0100
> @@ -76,6 +76,7 @@ check_match (const char *const undef_nam
>    unsigned int stt = ELFW(ST_TYPE) (sym->st_info);
>    assert (ELF_RTYPE_CLASS_PLT == 1);
>    if (__glibc_unlikely ((sym->st_value == 0 /* No value.  */
> +			 && sym->st_shndx != SHN_ABS
>  			 && stt != STT_TLS)
>  			|| ELF_MACHINE_SYM_NO_MATCH (sym)
>  			|| (type_class & (sym->st_shndx == SHN_UNDEF))))

Context here:

  unsigned int stt = ELFW(ST_TYPE) (sym->st_info);
  assert (ELF_RTYPE_CLASS_PLT == 1);
  if (__glibc_unlikely ((sym->st_value == 0 /* No value.  */
			 && stt != STT_TLS)
			|| ELF_MACHINE_SYM_NO_MATCH (sym)
			|| (type_class & (sym->st_shndx == SHN_UNDEF))))
    return NULL;

So this looks good.

> Index: glibc/elf/tst-absolute-zero-lib.c
> ===================================================================
> --- /dev/null	1970-01-01 00:00:00.000000000 +0000
> +++ glibc/elf/tst-absolute-zero-lib.c	2018-06-18 18:12:40.102324540 +0100
> @@ -0,0 +1,25 @@
> +/* BZ #xxxxx absolute zero symbol calculation shared module.

Needs Bugzilla number.

> Index: glibc/elf/tst-absolute-zero.c
> ===================================================================
> --- /dev/null	1970-01-01 00:00:00.000000000 +0000
> +++ glibc/elf/tst-absolute-zero.c	2018-06-18 18:12:40.147611912 +0100
> @@ -0,0 +1,38 @@
> +/* BZ #xxxxx absolute zero symbol calculation main executable.

Likewise.


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