summary refs log tree commit diff
path: root/elf/readelflib.c
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2022-03-04 10:27:15 -0300
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2022-05-16 15:03:49 -0300
commitc628c2296392ed3bf2cb8d8470668e64fe53389f (patch)
tree9b81205495c9f84e216555e5630ece715a1c1523 /elf/readelflib.c
parentb46d250656794e63a2946c481fda29271342dd1a (diff)
downloadglibc-c628c2296392ed3bf2cb8d8470668e64fe53389f.tar.gz
glibc-c628c2296392ed3bf2cb8d8470668e64fe53389f.tar.xz
glibc-c628c2296392ed3bf2cb8d8470668e64fe53389f.zip
elf: Remove ldconfig kernel version check
Now that it was removed on libc.so.
Diffstat (limited to 'elf/readelflib.c')
-rw-r--r--elf/readelflib.c51
1 files changed, 2 insertions, 49 deletions
diff --git a/elf/readelflib.c b/elf/readelflib.c
index e147416363..771182b5d0 100644
--- a/elf/readelflib.c
+++ b/elf/readelflib.c
@@ -40,8 +40,8 @@ do								\
 /* Returns 0 if everything is ok, != 0 in case of error.  */
 int
 process_elf_file (const char *file_name, const char *lib, int *flag,
-		  unsigned int *osversion, unsigned int *isa_level,
-		  char **soname, void *file_contents, size_t file_length)
+		  unsigned int *isa_level, char **soname, void *file_contents,
+		  size_t file_length)
 {
   int i;
   unsigned int j;
@@ -55,7 +55,6 @@ process_elf_file (const char *file_name, const char *lib, int *flag,
   char *dynamic_strings;
 
   elf_header = (ElfW(Ehdr) *) file_contents;
-  *osversion = 0;
 
   if (elf_header->e_ident [EI_CLASS] != ElfW (CLASS))
     {
@@ -121,52 +120,6 @@ process_elf_file (const char *file_name, const char *lib, int *flag,
 	      }
 	  break;
 
-	case PT_NOTE:
-	  if (!*osversion && segment->p_filesz >= 32 && segment->p_align >= 4)
-	    {
-	      ElfW(Word) *abi_note = (ElfW(Word) *) (file_contents
-						     + segment->p_offset);
-	      ElfW(Addr) size = segment->p_filesz;
-	      /* NB: Some PT_NOTE segment may have alignment value of 0
-		 or 1.  gABI specifies that PT_NOTE segments should be
-		 aligned to 4 bytes in 32-bit objects and to 8 bytes in
-		 64-bit objects.  As a Linux extension, we also support
-		 4 byte alignment in 64-bit objects.  If p_align is less
-		 than 4, we treate alignment as 4 bytes since some note
-		 segments have 0 or 1 byte alignment.   */
-	      ElfW(Addr) align = segment->p_align;
-	      if (align < 4)
-		align = 4;
-	      else if (align != 4 && align != 8)
-		continue;
-
-	      while (abi_note [0] != 4 || abi_note [1] != 16
-		     || abi_note [2] != 1
-		     || memcmp (abi_note + 3, "GNU", 4) != 0)
-		{
-		  ElfW(Addr) note_size
-		    = ELF_NOTE_NEXT_OFFSET (abi_note[0], abi_note[1],
-					    align);
-
-		  if (size - 32 < note_size || note_size == 0)
-		    {
-		      size = 0;
-		      break;
-		    }
-		  size -= note_size;
-		  abi_note = (void *) abi_note + note_size;
-		}
-
-	      if (size == 0)
-		break;
-
-	      *osversion = ((abi_note [4] << 24)
-			    | ((abi_note [5] & 0xff) << 16)
-			    | ((abi_note [6] & 0xff) << 8)
-			    | (abi_note [7] & 0xff));
-	    }
-	  break;
-
 	case PT_GNU_PROPERTY:
 	  /* The NT_GNU_PROPERTY_TYPE_0 note must be aligned to 4 bytes
 	     in 32-bit objects and to 8 bytes in 64-bit objects.  Skip