• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Aucun tag

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

GNU Binutils with patches for OS216


Commit MetaInfo

Révisionc4ab9505b53cdc899506ed421fddb7e1f8faf7a3 (tree)
l'heure2017-04-26 05:11:49
AuteurMaciej W. Rozycki <macro@imgt...>
CommiterMaciej W. Rozycki

Message de Log

MIPS/readelf: Simplify GOT[1] data availability check

Unavailable data is handled gracefully in MIPS GOT processing done by
print_mips_got_entry', so all that is needed in special GOT[1] handling
is to verify whether data can be retrieved for the purpose of the GNU
marker check done with
byte_get'. Remove the extra error reporting
code then, introduced with commit 75ec1fdbb797 ("Fix runtime seg-fault
in readelf when parsing a corrupt MIPS binary.") in the course of
addressing PR binutils/21344, and defer the error case to regular local
GOT entry processing.

binutils/
* readelf.c (process_mips_specific): Remove error reporting from
GOT[1] processing.

Change Summary

Modification

--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,5 +1,10 @@
11 2017-04-25 Maciej W. Rozycki <macro@imgtec.com>
22
3+ * readelf.c (process_mips_specific): Remove error reporting from
4+ GOT[1] processing.
5+
6+2017-04-25 Maciej W. Rozycki <macro@imgtec.com>
7+
38 * readelf.c (process_mips_specific): Remove null GOT data check.
49
510 2017-04-25 Maciej W. Rozycki <macro@imgtec.com>
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -15500,24 +15500,20 @@ process_mips_specific (FILE * file)
1550015500 if (ent == (bfd_vma) -1)
1550115501 goto got_print_fail;
1550215502
15503- if (data)
15504- {
15505- /* PR 21344 */
15506- if (data + ent - pltgot > data_end - addr_size)
15507- {
15508- error (_("Invalid got entry - %#lx - overflows GOT table\n"),
15509- (long) ent);
15510- goto got_print_fail;
15511- }
15512-
15513- if (byte_get (data + ent - pltgot, addr_size)
15514- >> (addr_size * 8 - 1) != 0)
15515- {
15516- ent = print_mips_got_entry (data, pltgot, ent, data_end);
15517- printf (_(" Module pointer (GNU extension)\n"));
15518- if (ent == (bfd_vma) -1)
15519- goto got_print_fail;
15520- }
15503+ /* Check for the MSB of GOT[1] being set, denoting a GNU object.
15504+ This entry will be used by some runtime loaders, to store the
15505+ module pointer. Otherwise this is an ordinary local entry.
15506+ PR 21344: Check for the entry being fully available before
15507+ fetching it. */
15508+ if (data
15509+ && data + ent - pltgot + addr_size <= data_end
15510+ && (byte_get (data + ent - pltgot, addr_size)
15511+ >> (addr_size * 8 - 1)) != 0)
15512+ {
15513+ ent = print_mips_got_entry (data, pltgot, ent, data_end);
15514+ printf (_(" Module pointer (GNU extension)\n"));
15515+ if (ent == (bfd_vma) -1)
15516+ goto got_print_fail;
1552115517 }
1552215518 printf ("\n");
1552315519