Ensure flags stored to raw relo record is 16 bits - #17982
Conversation
|
@jdmpapin could you please review? |
The main change in this regard seems to be that |
Yeah I can update the commit message. As far as I can tell, nothing really depends on the relo flags not being preserved; however, because |
The _flags field of the TR_RelocationRecordBinaryTemplate struct is 16 bits wide. This was to ensure that the relocation infrastructure could store more than 4 bits of Relocation Flags (the other 4 bits are reserved for the Cross Platform Flags). The code in TR_RelocationRecord::setReloFlags did some validation to ensure that the bits did not overlap; however, it did so using a uint8_t which could lose some bits due to a shift. This commit fixes this by ensuring a uint16_t is used. This commit also changes how the flags are set; existing flags in the raw relocation record are now preserved. Prior to this change, setFlags preserved the Cross Platform Flags but setReloFlags did not preserve the Relo Flags. Nothing currently depends on this behaviour. Therefore, to strengthen the conceptual integrity of these APIs, this commit makes the behaviour of both setFlags and setReloFlags consistent. Signed-off-by: Irwin D'Souza <dsouzai.gh@gmail.com>
|
Updated commit message. |
|
Jenkins test sanity.functional+aot all jdk17 |
|
Build failures due to #17527 (review) |
|
Realized that this PR actually does fix a bug (introduced by #17621), namely that the |
|
Relaunching PR builds since #17986 has been merged: Jenkins test sanity.functional+aot all jdk17 |
|
x86 failure is due to an infra issue: aix failure is due to #17396: |
|
Jenkins test sanity+aot xlinux,aix jdk17 |
|
Jenkins test sanity.functional+aot xlinux,aix jdk17 |
|
aix failure due to the same issue I've always had the suspicion, but now I'm starting to really think that issue is related to AOT and not infra. At any rate, this PR should be good for merging. |
The
_flagsfield of theTR_RelocationRecordBinaryTemplatestruct is 16 bits wide. This was to ensure that the relocation infrastructure could store more than 4 bits of Relocation Flags (the other 4 bits are reserved for the Cross Platform Flags).The code in
TR_RelocationRecord::setReloFlagsdid some validation to ensure that the bits did not overlap; however, it did so using a uint8_t which could lose some bits due to a shift. This PR fixes this by ensuring auint16_tis used.This PR also changes how the flags are set; existing flags in the raw relocation record are now preserved.