@@ -500,7 +500,8 @@ Error LinuxKernelRewriter::readORCTables() {
500
500
// Consume the status of the cursor.
501
501
if (!IPCursor)
502
502
return createStringError (errc::executable_format_error,
503
- " out of bounds while reading ORC IP table" );
503
+ " out of bounds while reading ORC IP table: %s" ,
504
+ toString (IPCursor.takeError ()).c_str ());
504
505
505
506
if (IP < PrevIP && opts::Verbosity)
506
507
BC.errs () << " BOLT-WARNING: out of order IP 0x" << Twine::utohexstr (IP)
@@ -522,7 +523,8 @@ Error LinuxKernelRewriter::readORCTables() {
522
523
// Consume the status of the cursor.
523
524
if (!ORCCursor)
524
525
return createStringError (errc::executable_format_error,
525
- " out of bounds while reading ORC" );
526
+ " out of bounds while reading ORC: %s" ,
527
+ toString (ORCCursor.takeError ()).c_str ());
526
528
527
529
if (Entry.ORC == NullORC)
528
530
continue ;
@@ -843,7 +845,8 @@ Error LinuxKernelRewriter::readStaticCalls() {
843
845
// Consume the status of the cursor.
844
846
if (!Cursor)
845
847
return createStringError (errc::executable_format_error,
846
- " out of bounds while reading static calls" );
848
+ " out of bounds while reading static calls: %s" ,
849
+ toString (Cursor.takeError ()).c_str ());
847
850
848
851
++EntryID;
849
852
@@ -954,8 +957,10 @@ Error LinuxKernelRewriter::readExceptionTable() {
954
957
955
958
// Consume the status of the cursor.
956
959
if (!Cursor)
957
- return createStringError (errc::executable_format_error,
958
- " out of bounds while reading exception table" );
960
+ return createStringError (
961
+ errc::executable_format_error,
962
+ " out of bounds while reading exception table: %s" ,
963
+ toString (Cursor.takeError ()).c_str ());
959
964
960
965
++EntryID;
961
966
@@ -1061,8 +1066,10 @@ Error LinuxKernelRewriter::readParaInstructions() {
1061
1066
const uint8_t Len = DE.getU8 (Cursor);
1062
1067
1063
1068
if (!Cursor)
1064
- return createStringError (errc::executable_format_error,
1065
- " out of bounds while reading .parainstructions" );
1069
+ return createStringError (
1070
+ errc::executable_format_error,
1071
+ " out of bounds while reading .parainstructions: %s" ,
1072
+ toString (Cursor.takeError ()).c_str ());
1066
1073
1067
1074
++EntryID;
1068
1075
@@ -1129,7 +1136,8 @@ Error LinuxKernelRewriter::readBugTable() {
1129
1136
1130
1137
if (!Cursor)
1131
1138
return createStringError (errc::executable_format_error,
1132
- " out of bounds while reading __bug_table" );
1139
+ " out of bounds while reading __bug_table: %s" ,
1140
+ toString (Cursor.takeError ()).c_str ());
1133
1141
1134
1142
++EntryID;
1135
1143
@@ -1196,8 +1204,10 @@ Error LinuxKernelRewriter::readAltInstructions() {
1196
1204
const uint8_t PadLen = opts::AltInstHasPadLen ? DE.getU8 (Cursor) : 0 ;
1197
1205
1198
1206
if (!Cursor)
1199
- return createStringError (errc::executable_format_error,
1200
- " out of bounds while reading .altinstructions" );
1207
+ return createStringError (
1208
+ errc::executable_format_error,
1209
+ " out of bounds while reading .altinstructions: %s" ,
1210
+ toString (Cursor.takeError ()).c_str ());
1201
1211
1202
1212
++EntryID;
1203
1213
0 commit comments