Skip to content

Commit

Permalink
Merge pull request #44 from GaloisInc/pate-mctrace
Browse files Browse the repository at this point in the history
elfSectionAsGOT: improve (and in some cases correct) error messages related to .got section conversion failures
  • Loading branch information
jtdaugherty committed Mar 20, 2024
2 parents 12b6254 + 3401f8f commit 8afa838
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Data/ElfEdit/HighLevel/GOT.hs
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,16 @@ elfSectionAsGOT :: (Bits w, Num w)
elfSectionAsGOT s = do
-- TODO: Perform checks
when (elfSectionType s /= SHT_PROGBITS) $ do
Left "Unexpected type"
Left "Unexpected .got section type (expected PROGBITS)"
when (elfSectionFlags s /= elfGotSectionFlags) $ do
Left "Unexpected type"
Left "Unexpected .got section flags (expected write/alloc)"
let d = elfSectionData s
when (elfSectionSize s /= fromIntegral (B.length d)) $ do
Left "Section size does not match data length."
Left ".got section size does not match data length."
when (elfSectionLink s /= 0) $ do
Left "Unexpected section length"
Left "Unexpected .got section length"
when (elfSectionInfo s /= 0) $ do
Left "Unexpected section info"
Left "Unexpected .got section info"
return ElfGOT { elfGotIndex = elfSectionIndex s
, elfGotName = elfSectionName s
, elfGotAddr = elfSectionAddr s
Expand Down

0 comments on commit 8afa838

Please sign in to comment.