--- old/src/jdk.hotspot.agent/linux/native/libsaproc/symtab.c 2020-03-11 14:45:56.380467700 +0900 +++ new/src/jdk.hotspot.agent/linux/native/libsaproc/symtab.c 2020-03-11 14:45:56.033216600 +0900 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -35,11 +35,6 @@ // functions for symbol lookups // ---------------------------------------------------- -struct elf_section { - ELF_SHDR *c_shdr; - void *c_data; -}; - struct elf_symbol { char *name; uintptr_t offset; @@ -158,37 +153,6 @@ } } -/* Find an ELF section. */ -static struct elf_section *find_section_by_name(char *name, - int fd, - ELF_EHDR *ehdr, - struct elf_section *scn_cache) -{ - char *strtab; - int cnt; - int strtab_size; - - // Section cache have to already contain data for e_shstrndx section. - // If it's not true - elf file is broken, so just bail out - if (scn_cache[ehdr->e_shstrndx].c_data == NULL) { - return NULL; - } - - strtab = scn_cache[ehdr->e_shstrndx].c_data; - strtab_size = scn_cache[ehdr->e_shstrndx].c_shdr->sh_size; - - for (cnt = 0; cnt < ehdr->e_shnum; ++cnt) { - if (scn_cache[cnt].c_shdr->sh_name < strtab_size) { - if (strcmp(scn_cache[cnt].c_shdr->sh_name + strtab, name) == 0) { - scn_cache[cnt].c_data = read_section_data(fd, ehdr, scn_cache[cnt].c_shdr); - return &scn_cache[cnt]; - } - } - } - - return NULL; -} - /* Look for a ".gnu_debuglink" section. If one exists, try to open a suitable debuginfo file. */ static int open_file_from_debug_link(const char *name,