Bug 20823 - invalid "tail +16c" still used
Summary: invalid "tail +16c" still used
Status: CLOSED FIXED
Alias: None
Product: binutils
Classification: Unclassified
Component: ld (show other bugs)
Version: 2.28
: P2 enhancement
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-11-15 06:17 UTC by ma.jiang
Modified: 2016-11-29 02:00 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments
change all "tail +16c" to "tail -c +16" (917 bytes, patch)
2016-11-15 06:17 UTC, ma.jiang
Details | Diff
change all "tail +16c" to "tail -c +16" (912 bytes, patch)
2016-11-15 06:47 UTC, ma.jiang
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description ma.jiang 2016-11-15 06:17:27 UTC
Created attachment 9634 [details]
change all "tail +16c" to "tail -c +16"

When porting patches from binutils2.24 to latest 2.27, I found some old mistakes still existed. "tail" now treat operands with leading '+' as file names, as POSIX has required since 2001. But there were still some uses of "tail +16c" in binutils. Attached patch change all "tail +16c" to valid "tail +c", is that ok?
Comment 1 ma.jiang 2016-11-15 06:47:30 UTC
Created attachment 9635 [details]
change all "tail +16c" to "tail -c +16"

sorry, please use this patch instead of the first one.
Comment 2 ma.jiang 2016-11-28 03:02:47 UTC
Hi Alan,
  I have added you to the CC list, as you replied my mail. Sorry, if it makes troubles. I have send some mails to gcc-patches@gcc.gnu.org as you suggested, but it seems that no one care... On the other side, I know that after your fix , gas could use the right command "cmp --ignore-initial" on most modern systems. Should we apply your patch first?
Comment 3 Alan Modra 2016-11-28 03:29:27 UTC
I applied the gas patch a week ago.  git commit 2d7f2507d.
Comment 4 ma.jiang 2016-11-28 03:44:36 UTC
(In reply to Alan Modra from comment #3)
> I applied the gas patch a week ago.  git commit 2d7f2507d.

Hi Alan,
  Thanks. I have checked both binutils and gcc sources. Now that you have fix the problem, I will close the bug now. And by the way, please give me a note if you have get things done next time... I am sending mails time and time again to gcc-patches@gcc.gnu.org, like a fool...
Comment 5 ma.jiang 2016-11-28 05:54:52 UTC
(In reply to Alan Modra from comment #3)
> I applied the gas patch a week ago.  git commit 2d7f2507d.
  One more thing, How about the acx.m4 in gcc project? There are still "tail +16c" in that file.
Comment 6 Alan Modra 2016-11-28 10:25:28 UTC
Yes of course.  By the "gas patch", I meant the patch to gas/ that made the gas Makefile use the acx.m4 machinery.  We still have acx.m4 to fix, which we'll import from gcc when/if that patch goes in.  Note that I don't have any authority to approve the gcc patch, and the gcc folk may well reject it on the grounds that people with gnu tools won't be using tail anyway, so it may be better to keep using the ancient form of tail.
Comment 7 ma.jiang 2016-11-29 02:00:34 UTC
(In reply to Alan Modra from comment #6)
> Yes of course.  By the "gas patch", I meant the patch to gas/ that made the
> gas Makefile use the acx.m4 machinery.  We still have acx.m4 to fix, which
> we'll import from gcc when/if that patch goes in.  Note that I don't have
> any authority to approve the gcc patch, and the gcc folk may well reject it
> on the grounds that people with gnu tools won't be using tail anyway, so it
> may be better to keep using the ancient form of tail.

Hi Alan,
  Thanks for the reply. I'll keep sending the gcc patch for some time, although  I guess you are right... It seems that the gcc guys do not care this tiny problem.