This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Strange strings in GCC compiled code


Eli Zaretskii <eliz@gnu.org> writes:
>> Windows doesn't clear out blocks used by old files; it happily reuses them
>> with their data intact, just puts an end of file marker before the old
>> junk.  So it's quite common to see all sorts of random old data off your
>> disk end up at the end of various files.
>
>The above is true AFAIK.  However, it doesn't have anything to do with
>the problem described by the original poster.  The problem was that
>this junk was reported by the `strings' utility.  Since `strings' uses
>normal file I/O (as opposed to direct disk reads), it cannot see
>anything beyond the last byte of the actual file data.  The junk you
>describe begins *after* the file's data.
>
>In other words, the junk reported by the original poster was part of
>the file's data, not something beyond the (logical) EOF marker.

But if (as is likely) binutils seeks down the file and does a write
then junk is exposed if not overwritten.

-- 
Nick Ing-Simmons <nik@tiuk.ti.com>
Via, but not speaking for: Texas Instruments Ltd.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]