P4 to Git Change 1193950 by nhaustov@nhaustov_hsa on 2015/09/24 04:08:17
SWDEV-77164 - Remove libelf differences from original elftoolchain. These erroneously make ELF_C_RDWR not to load existing section headers. Testing: pre-checkin Affected files ... ... //depot/stg/opencl/drivers/opencl/compiler/lib/loaders/elf/utils/libelf/elf_scn.c#4 edit
This commit is contained in:
@@ -154,11 +154,7 @@ elf_getscn(Elf *e, size_t index)
|
||||
if ((ehdr = _libelf_ehdr(e, ec, 0)) == NULL)
|
||||
return (NULL);
|
||||
|
||||
// If we aren't a read/write from a file or a read only elf,
|
||||
// make sure that the headers are loaded. If we are a read/write
|
||||
// from a file, we should have the headers loaded already.
|
||||
if ((e->e_cmd == ELF_C_READ
|
||||
|| (e->e_cmd == ELF_C_RDWR && e->e_fd == -1)) &&
|
||||
if (e->e_cmd != ELF_C_WRITE &&
|
||||
(e->e_flags & LIBELF_F_SHDRS_LOADED) == 0 &&
|
||||
_libelf_load_section_headers(e, ehdr) == 0)
|
||||
return (NULL);
|
||||
@@ -211,8 +207,7 @@ elf_newscn(Elf *e)
|
||||
* file using ELF_C_READ, mess with its internal structure and
|
||||
* use elf_update(...,ELF_C_NULL) to compute its new layout.
|
||||
*/
|
||||
if ((e->e_cmd == ELF_C_READ
|
||||
|| (e->e_cmd == ELF_C_RDWR && e->e_fd == -1)) &&
|
||||
if (e->e_cmd != ELF_C_WRITE &&
|
||||
(e->e_flags & LIBELF_F_SHDRS_LOADED) == 0 &&
|
||||
_libelf_load_section_headers(e, ehdr) == 0)
|
||||
return (NULL);
|
||||
|
||||
Reference in New Issue
Block a user