public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] ld/testsuite: handle Windows drive letter in persistent section
@ 2023-02-21  9:03 Clément Chigot
  2023-02-21  9:14 ` Clément Chigot
  2023-02-21  9:25 ` Jan Beulich
  0 siblings, 2 replies; 4+ messages in thread
From: Clément Chigot @ 2023-02-21  9:03 UTC (permalink / raw)
  To: binutils; +Cc: amodra, Clément Chigot

The regexp in ".persistent sections (ld -r)" is skipping the file path
before the first ":". However, on Windows, a path can start with "C:".
Adjust the regexp to allow such cases.

ld/ChangeLog:

        * testsuite/ld-elf/persistent-sections-2.l: Allow Windows
        paths (starting with C:).
---
 ld/testsuite/ld-elf/persistent-sections-2.l | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ld/testsuite/ld-elf/persistent-sections-2.l b/ld/testsuite/ld-elf/persistent-sections-2.l
index a5bbe4b04f2..e28cb98f72a 100644
--- a/ld/testsuite/ld-elf/persistent-sections-2.l
+++ b/ld/testsuite/ld-elf/persistent-sections-2.l
@@ -1,5 +1,5 @@
 #...
-[^:]*: warning: orphan section `.persistent.var_persistent' from \S+ being placed in section `.persistent.var_persistent'
+(|.:)[^:]*: warning: orphan section `.persistent.var_persistent' from \S+ being placed in section `.persistent.var_persistent'
 #...
-[^:]*: warning: orphan section `.gnu.linkonce.p.var_persistent2' from \S+ being placed in section `.gnu.linkonce.p.var_persistent2'
+(|.:)[^:]*: warning: orphan section `.gnu.linkonce.p.var_persistent2' from \S+ being placed in section `.gnu.linkonce.p.var_persistent2'
 #pass
-- 
2.25.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ld/testsuite: handle Windows drive letter in persistent section
  2023-02-21  9:03 [PATCH] ld/testsuite: handle Windows drive letter in persistent section Clément Chigot
@ 2023-02-21  9:14 ` Clément Chigot
  2023-02-21  9:25 ` Jan Beulich
  1 sibling, 0 replies; 4+ messages in thread
From: Clément Chigot @ 2023-02-21  9:14 UTC (permalink / raw)
  To: binutils; +Cc: amodra

Hi Alan,

Here is another test having an issue with paths starting with C:, that
I've missed in first place.

However, it had made me wonder if no other tests would have this issue
(even if I'm not launching because of whatever reasons).
For ld/testsuite, noinit sections and this one seems the only ones
having this pattern "[^:] :".

However, in gas/testsuite, there are plenty of them, more than 16k lines.
But, investigating deeper, I don't have issues with them on my setup
because gas errors are based on the targeted files and I'm passing
them with a Linux path-style.
  | $ gas /a/random/path.s
  | /a/random/path.s: error ...

With ld, the error is printing the ld executable path which in my case
is a Windows-style path.
  | $ ld /a/random/path.o
  | C:/path/to/ld.exe: error ...

All that to say, as is, I don't have to modify any testcase in
gas/testsuite. But to be coherent, I guess it would be better to do
it.
But as it represents huge modifications, I would like to have your
opinion on that first.

Thanks, Clément

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ld/testsuite: handle Windows drive letter in persistent section
  2023-02-21  9:03 [PATCH] ld/testsuite: handle Windows drive letter in persistent section Clément Chigot
  2023-02-21  9:14 ` Clément Chigot
@ 2023-02-21  9:25 ` Jan Beulich
  2023-02-21 16:16   ` Clément Chigot
  1 sibling, 1 reply; 4+ messages in thread
From: Jan Beulich @ 2023-02-21  9:25 UTC (permalink / raw)
  To: Clément Chigot; +Cc: amodra, binutils

On 21.02.2023 10:03, Clément Chigot via Binutils wrote:
> --- a/ld/testsuite/ld-elf/persistent-sections-2.l
> +++ b/ld/testsuite/ld-elf/persistent-sections-2.l
> @@ -1,5 +1,5 @@
>  #...
> -[^:]*: warning: orphan section `.persistent.var_persistent' from \S+ being placed in section `.persistent.var_persistent'
> +(|.:)[^:]*: warning: orphan section `.persistent.var_persistent' from \S+ being placed in section `.persistent.var_persistent'
>  #...
> -[^:]*: warning: orphan section `.gnu.linkonce.p.var_persistent2' from \S+ being placed in section `.gnu.linkonce.p.var_persistent2'
> +(|.:)[^:]*: warning: orphan section `.gnu.linkonce.p.var_persistent2' from \S+ being placed in section `.gnu.linkonce.p.var_persistent2'

Personally I find "(|.:)" slightly less intuitive than "(.:)?", so could
I maybe talk you into using the alternative form?

However, seeing your further reply (mainly targeted at Alan) I also
wonder whether the issue can't be addressed in a more general manner, by
pruning drive letters from diagnostics before actually doing any regexp
matching. Such pruning could then also be limited to actually running on
Windows, whereas changing expectations in test cases would affect all
targets.

Jan

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ld/testsuite: handle Windows drive letter in persistent section
  2023-02-21  9:25 ` Jan Beulich
@ 2023-02-21 16:16   ` Clément Chigot
  0 siblings, 0 replies; 4+ messages in thread
From: Clément Chigot @ 2023-02-21 16:16 UTC (permalink / raw)
  To: Jan Beulich; +Cc: amodra, binutils

On Tue, Feb 21, 2023 at 10:25 AM Jan Beulich <jbeulich@suse.com> wrote:
>
> On 21.02.2023 10:03, Clément Chigot via Binutils wrote:
> > --- a/ld/testsuite/ld-elf/persistent-sections-2.l
> > +++ b/ld/testsuite/ld-elf/persistent-sections-2.l
> > @@ -1,5 +1,5 @@
> >  #...
> > -[^:]*: warning: orphan section `.persistent.var_persistent' from \S+ being placed in section `.persistent.var_persistent'
> > +(|.:)[^:]*: warning: orphan section `.persistent.var_persistent' from \S+ being placed in section `.persistent.var_persistent'
> >  #...
> > -[^:]*: warning: orphan section `.gnu.linkonce.p.var_persistent2' from \S+ being placed in section `.gnu.linkonce.p.var_persistent2'
> > +(|.:)[^:]*: warning: orphan section `.gnu.linkonce.p.var_persistent2' from \S+ being placed in section `.gnu.linkonce.p.var_persistent2'
>
> Personally I find "(|.:)" slightly less intuitive than "(.:)?", so could
> I maybe talk you into using the alternative form?
>
> However, seeing your further reply (mainly targeted at Alan) I also
> wonder whether the issue can't be addressed in a more general manner, by
> pruning drive letters from diagnostics before actually doing any regexp
> matching. Such pruning could then also be limited to actually running on
> Windows, whereas changing expectations in test cases would affect all
> targets.

For the record, I have pushed "testsuite: prune DOS drive letter in
test outputs", implementing Jan's idea.

Clément

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-02-21 16:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-21  9:03 [PATCH] ld/testsuite: handle Windows drive letter in persistent section Clément Chigot
2023-02-21  9:14 ` Clément Chigot
2023-02-21  9:25 ` Jan Beulich
2023-02-21 16:16   ` Clément Chigot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).