NetBSD Problem Report #42840
From martin@aprisoft.de Thu Feb 18 12:41:35 2010
Return-Path: <martin@aprisoft.de>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
by www.NetBSD.org (Postfix) with ESMTP id E4A3B63B11D
for <gnats-bugs@gnats.NetBSD.org>; Thu, 18 Feb 2010 12:41:34 +0000 (UTC)
Message-Id: <20100218124121.04056AF5818@emmas.aprisoft.de>
Date: Thu, 18 Feb 2010 13:41:21 +0100 (CET)
From: martin@NetBSD.org
Reply-To: martin@NetBSD.org
To: gnats-bugs@gnats.NetBSD.org
Subject: xstr obfuscation not needed any more?
X-Send-Pr-Version: 3.95
>Number: 42840
>Category: toolchain
>Synopsis: xstr obfuscation not needed any more?
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: toolchain-manager
>State: open
>Class: change-request
>Submitter-Id: net
>Arrival-Date: Thu Feb 18 12:45:00 +0000 2010
>Last-Modified: Fri Feb 19 21:25:01 +0000 2010
>Originator: Martin Husemann
>Release: NetBSD 5.99.24
>Organization:
The NetBSD Foundation, Inc.
>Environment:
System: NetBSD nelly.aprisoft.de 5.99.24 NetBSD 5.99.24 (NELLY.MP) #114: Tue Feb 9 11:19:15 CET 2010 martin@emmas.aprisoft.de:/nelly/usr/src/sys/arch/sparc64/compile/NELLY.MP sparc64
Architecture: sparc64
Machine: sparc64
>Description:
While looking at some sysinst code I came around this strange line:
{ PART_SWAP, { 's', 'w', 'a', 'p', '\0' },
(and a few more with the same style). Scratching my head, checking that "swap"
instead generates the same object code, asking around... long story short,
this is due to limitations in the xstr(1) parser, and once upon a time
apparently this was used, via setting SHAREDSTRINGS in the makefile, to
eliminate duplicate strings.
However, our .mk docs say:
SHAREDSTRINGS If defined, a new .c.o rule is used that results in shared
strings, using xstr(1). Note that this will not work with
parallel makes.
and with no suprise I am unable to find any use of xstr or SHAREDSTRINGS
in our current build.
If this is the case, the code should be cleaned up to make it readable
again.
>How-To-Repeat:
code inspection
>Fix:
Verify that xstr isn't used any more, de-obfuscate all relevant sources?
>Audit-Trail:
From: David Laight <david@l8s.co.uk>
To: gnats-bugs@NetBSD.org
Cc: toolchain-manager@netbsd.org, gnats-admin@netbsd.org,
netbsd-bugs@netbsd.org
Subject: Re: toolchain/42840: xstr obfuscation not needed any more?
Date: Fri, 19 Feb 2010 21:19:24 +0000
On Thu, Feb 18, 2010 at 12:45:00PM +0000, martin@NetBSD.org wrote:
> >Number: 42840
> >Category: toolchain
> >Synopsis: xstr obfuscation not needed any more?
...
> While looking at some sysinst code I came around this strange line:
>
> { PART_SWAP, { 's', 'w', 'a', 'p', '\0' },
christos made those changes relatively recently (ie in the last few years).
IIRC it was something to do with some tool that scanned the source file
for "xxxx" and tried to merge them together - and it got confused by
array initialisers.
Given that ld(1) will merge strings these days I'm not at all sure of
the justification at all!
David
--
David Laight: david@l8s.co.uk
(Contact us)
$NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.