On Thu, 17 Aug 2023 02:06:22 GMT, David Holmes <dhol...@openjdk.org> wrote:

>> src/hotspot/share/utilities/elfFile.hpp line 486:
>> 
>>> 484:     DwarfFile* _dwarf_file;
>>> 485:     MarkedDwarfFileReader _reader;
>>> 486:     uintptr_t _section_start_address;
>> 
>> This seems suspicious - is this a 32-bit value or 64-bit?
>
> I see Dean indicated this is platform specific, but I don't know how. It 
> sounds like this is a bug if it should be 64-bit.

I think `uint32_t` was wrong here since it could be a larger 64-bit value on 
64-bit platforms. `ElfShdr` is a `typedef` for `Elf64_Shdr` here which 
specifies `sh_offset` as `uint64_t`:
https://github.com/openjdk/jdk/blob/43311930107d1783b742adbe567e9bdbcb55775d/src/hotspot/share/utilities/elfFile.cpp#L747-L752

 I guess `sh_offset` was just never larger than 32-bits in practice, so it went 
unnoticed.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/15233#discussion_r1296812239

Reply via email to