diff --git a/ld/ChangeLog b/ld/ChangeLog index 9fcc55ce3c4..4145096afc8 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,8 @@ +2019-07-20 Alan Modra + + PR 24827 + * ldlex.l (comment): Check for 0 return from YY_INPUT, not EOF. + 2019-07-19 Alan Modra * testsuite/ld-powerpc/tlsgd.d, diff --git a/ld/ldlex.l b/ld/ldlex.l index c2abc59571d..a5c3ba59992 100644 --- a/ld/ldlex.l +++ b/ld/ldlex.l @@ -675,7 +675,7 @@ comment (void) while (1) { c = input(); - while (c != '*' && c != EOF) + while (c != '*' && c != 0) { if (c == '\n') lineno++; @@ -694,7 +694,7 @@ comment (void) if (c == '\n') lineno++; - if (c == EOF) + if (c == 0) { einfo (_("%F%P: EOF in comment\n")); break;