core/glibc to 2.31-1

This commit is contained in:
Kevin Mihelich 2020-02-11 13:34:12 +00:00
parent 8674705ca7
commit de429bdb21
2 changed files with 8 additions and 95 deletions

View file

@ -14,30 +14,28 @@
noautobuild=1
pkgname=glibc
pkgver=2.30
pkgrel=3
pkgver=2.31
pkgrel=1
arch=(x86_64)
url='https://www.gnu.org/software/libc'
license=(GPL LGPL)
makedepends=(git gd python)
options=(!strip staticlibs !distcc)
#source=(https://ftp.gnu.org/gnu/glibc/glibc-$pkgver.tar.xz{,.sig}
_commit=a6aaabd036d735a1b412f441bf6c706832655598
source=(git+https://sourceware.org/git/glibc.git#commit=$_commit
#source=(git+https://sourceware.org/git/glibc.git#commit=$_commit
source=(https://ftp.gnu.org/gnu/glibc/glibc-$pkgver.tar.xz{,.sig}
locale.gen.txt
locale-gen
sdt.h sdt-config.h
bz20338.patch
file-truncated-while-reading-soname-after-patchelf.patch)
bz20338.patch)
validpgpkeys=(7273542B39962DF7B299931416792B4EA25340F8 # Carlos O'Donell
BC7C7372637EC10C57D7AA6579C43DFBF1CF2187) # Siddhesh Poyarekar
md5sums=('SKIP'
md5sums=('78a720f17412f3c3282be5a6f3363ec6'
'SKIP'
'07ac979b6ab5eeb778d55f041529d623'
'476e9113489f93b348b21e144b6a8fcf'
'91fec3b7e75510ae2ac42533aa2e695e'
'680df504c683640b02ed4a805797c0b2'
'430673eccc78e52c249aa4b0f1786450'
'0820504d2e83ee15f74a656771361872')
'430673eccc78e52c249aa4b0f1786450')
prepare() {
mkdir -p glibc-build

View file

@ -1,85 +0,0 @@
[PATCH] ldconfig: file truncated while reading soname after patchelf [BZ #23964]
The way loadaddr is computed from the first LOAD segment in process_elf_file
assumes .dynstr is also contained in that segment. That is not necessarily
true, especially for libraries that have been touched by patchelf.
With this patch, the address read from the dynamic segment is checked against
all applicable segments instead of only the first one.
[BZ #23964]
* elf/readelflib.c: Fix resolving of loadaddr for .dynstr vaddr.
---
elf/readelflib.c | 33 ++++++++++++++++-----------------
1 file changed, 16 insertions(+), 17 deletions(-)
diff --git a/elf/readelflib.c b/elf/readelflib.c
index 5a1e2dc2df..bc1195c175 100644
--- a/elf/readelflib.c
+++ b/elf/readelflib.c
@@ -98,11 +98,6 @@ process_elf_file (const char *file_name, const char *lib, int *flag,
switch (segment->p_type)
{
- case PT_LOAD:
- if (loadaddr == (ElfW(Addr)) -1)
- loadaddr = segment->p_vaddr - segment->p_offset;
- break;
-
case PT_DYNAMIC:
if (dynamic_addr)
error (0, 0, _("more than one dynamic segment\n"));
@@ -176,11 +171,6 @@ process_elf_file (const char *file_name, const char *lib, int *flag,
}
}
- if (loadaddr == (ElfW(Addr)) -1)
- {
- /* Very strange. */
- loadaddr = 0;
- }
/* Now we can read the dynamic sections. */
if (dynamic_size == 0)
@@ -190,22 +180,31 @@ process_elf_file (const char *file_name, const char *lib, int *flag,
check_ptr (dynamic_segment);
/* Find the string table. */
- dynamic_strings = NULL;
for (dyn_entry = dynamic_segment; dyn_entry->d_tag != DT_NULL;
++dyn_entry)
{
check_ptr (dyn_entry);
if (dyn_entry->d_tag == DT_STRTAB)
- {
- dynamic_strings = (char *) (file_contents + dyn_entry->d_un.d_val - loadaddr);
- check_ptr (dynamic_strings);
- break;
- }
+ break;
}
- if (dynamic_strings == NULL)
+ for (i = 0, segment = elf_pheader;i < elf_header->e_phnum; i++, segment++)
+ {
+ ElfW(Addr) vaddr = dyn_entry->d_un.d_ptr;
+ if (segment->p_type == PT_LOAD &&
+ vaddr >= segment->p_vaddr &&
+ vaddr < segment->p_vaddr + segment->p_filesz)
+ {
+ loadaddr = segment->p_vaddr - segment->p_offset;
+ break;
+ }
+ }
+ if (loadaddr == (ElfW(Addr)) -1)
return 1;
+ dynamic_strings = (char *) (file_contents + dyn_entry->d_un.d_val - loadaddr);
+ check_ptr (dynamic_strings);
+
/* Now read the DT_NEEDED and DT_SONAME entries. */
for (dyn_entry = dynamic_segment; dyn_entry->d_tag != DT_NULL;
++dyn_entry)
--
2.19.2