34
34
#include " jvm_io.h"
35
35
#include " logging/log.hpp"
36
36
#include " memory/allocation.inline.hpp"
37
- #include " memory/resourceArea.hpp"
38
37
#include " utilities/decoder.hpp"
39
38
#include " utilities/elfFile.hpp"
40
39
#include " utilities/elfFuncDescTable.hpp"
@@ -260,7 +259,7 @@ int ElfFile::section_by_name(const char* name, Elf_Shdr& hdr) {
260
259
assert (name != NULL , " No section name" );
261
260
size_t len = strlen (name) + 1 ;
262
261
ResourceMark rm;
263
- char * buf = NEW_RESOURCE_ARRAY (char , len );
262
+ char * buf = (char *) os::malloc (len, mtInternal );
264
263
if (buf == NULL ) {
265
264
return -1 ;
266
265
}
@@ -282,6 +281,9 @@ int ElfFile::section_by_name(const char* name, Elf_Shdr& hdr) {
282
281
}
283
282
}
284
283
}
284
+
285
+ os::free (buf);
286
+
285
287
return sect_index;
286
288
}
287
289
#endif
@@ -350,7 +352,6 @@ ElfStringTable* ElfFile::get_string_table(int index) {
350
352
// Use unified logging to report errors rather than assert() throughout this method as this code is already part of the error reporting
351
353
// and the debug symbols might be in an unsupported DWARF version or wrong format.
352
354
bool ElfFile::get_source_info (const uint32_t offset_in_library, char * filename, const size_t filename_len, int * line, bool is_pc_after_call) {
353
- ResourceMark rm;
354
355
if (!load_dwarf_file ()) {
355
356
// Some ELF libraries do not provide separate .debuginfo files. Check if the current ELF file has the required
356
357
// DWARF sections. If so, treat the current ELF file as DWARF file.
0 commit comments