Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 13 Feb 2018 04:10:10 +0000 (UTC)
From:      Kyle Evans <kevans@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r329191 - in stable/11: stand/common sys/kern
Message-ID:  <201802130410.w1D4AAZZ091439@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kevans
Date: Tue Feb 13 04:10:10 2018
New Revision: 329191
URL: https://svnweb.freebsd.org/changeset/base/329191

Log:
  Revert MFC r328911 from r329183
  
  jhb@ had specified an MFC timer of 1-month, and I clobbered his efforts by
  MFC'ing it way prematurely. Back out that part of r329183 so it may be MFC'd
  when jhb is ready.

Modified:
  stable/11/stand/common/load_elf_obj.c
  stable/11/sys/kern/link_elf_obj.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/stand/common/load_elf_obj.c
==============================================================================
--- stable/11/stand/common/load_elf_obj.c	Tue Feb 13 03:44:50 2018	(r329190)
+++ stable/11/stand/common/load_elf_obj.c	Tue Feb 13 04:10:10 2018	(r329191)
@@ -280,8 +280,6 @@ __elfN(obj_loadimage)(struct preloaded_file *fp, elf_f
 		switch (shdr[i].sh_type) {
 		case SHT_REL:
 		case SHT_RELA:
-			if ((shdr[shdr[i].sh_info].sh_flags & SHF_ALLOC) == 0)
-				break;
 			lastaddr = roundup(lastaddr, shdr[i].sh_addralign);
 			shdr[i].sh_addr = (Elf_Addr)lastaddr;
 			lastaddr += shdr[i].sh_size;

Modified: stable/11/sys/kern/link_elf_obj.c
==============================================================================
--- stable/11/sys/kern/link_elf_obj.c	Tue Feb 13 03:44:50 2018	(r329190)
+++ stable/11/sys/kern/link_elf_obj.c	Tue Feb 13 04:10:10 2018	(r329191)
@@ -267,17 +267,9 @@ link_elf_link_preload(linker_class_t cls, const char *
 			symstrindex = shdr[i].sh_link;
 			break;
 		case SHT_REL:
-			/*
-			 * Ignore relocation tables for sections not
-			 * loaded by the loader.
-			 */
-			if (shdr[shdr[i].sh_info].sh_addr == 0)
-				break;
 			ef->nreltab++;
 			break;
 		case SHT_RELA:
-			if (shdr[shdr[i].sh_info].sh_addr == 0)
-				break;
 			ef->nrelatab++;
 			break;
 		}
@@ -399,16 +391,12 @@ link_elf_link_preload(linker_class_t cls, const char *
 			pb++;
 			break;
 		case SHT_REL:
-			if (shdr[shdr[i].sh_info].sh_addr == 0)
-				break;
 			ef->reltab[rl].rel = (Elf_Rel *)shdr[i].sh_addr;
 			ef->reltab[rl].nrel = shdr[i].sh_size / sizeof(Elf_Rel);
 			ef->reltab[rl].sec = shdr[i].sh_info;
 			rl++;
 			break;
 		case SHT_RELA:
-			if (shdr[shdr[i].sh_info].sh_addr == 0)
-				break;
 			ef->relatab[ra].rela = (Elf_Rela *)shdr[i].sh_addr;
 			ef->relatab[ra].nrela =
 			    shdr[i].sh_size / sizeof(Elf_Rela);
@@ -619,17 +607,9 @@ link_elf_load_file(linker_class_t cls, const char *fil
 			symstrindex = shdr[i].sh_link;
 			break;
 		case SHT_REL:
-			/*
-			 * Ignore relocation tables for unallocated
-			 * sections.
-			 */
-			if ((shdr[shdr[i].sh_info].sh_flags & SHF_ALLOC) == 0)
-				break;
 			ef->nreltab++;
 			break;
 		case SHT_RELA:
-			if ((shdr[shdr[i].sh_info].sh_flags & SHF_ALLOC) == 0)
-				break;
 			ef->nrelatab++;
 			break;
 		case SHT_STRTAB:
@@ -883,8 +863,6 @@ link_elf_load_file(linker_class_t cls, const char *fil
 			pb++;
 			break;
 		case SHT_REL:
-			if ((shdr[shdr[i].sh_info].sh_flags & SHF_ALLOC) == 0)
-				break;
 			ef->reltab[rl].rel = malloc(shdr[i].sh_size, M_LINKER,
 			    M_WAITOK);
 			ef->reltab[rl].nrel = shdr[i].sh_size / sizeof(Elf_Rel);
@@ -903,8 +881,6 @@ link_elf_load_file(linker_class_t cls, const char *fil
 			rl++;
 			break;
 		case SHT_RELA:
-			if ((shdr[shdr[i].sh_info].sh_flags & SHF_ALLOC) == 0)
-				break;
 			ef->relatab[ra].rela = malloc(shdr[i].sh_size, M_LINKER,
 			    M_WAITOK);
 			ef->relatab[ra].nrela =



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201802130410.w1D4AAZZ091439>