From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from arjuna.pair.com (arjuna.pair.com [209.68.5.131]) by sourceware.org (Postfix) with ESMTPS id 1CF5F3858C42 for ; Sat, 27 Apr 2024 00:46:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1CF5F3858C42 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=bitrange.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=bitrange.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 1CF5F3858C42 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=209.68.5.131 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1714178776; cv=none; b=vtugOsU+hzCgSHl/oePlueb5r61zLb+KQWY4g5TyC9eDwhsIuUz6fsJ+pXLQNt0mQ1WNOwOkaZRimfG8/zFYUj7+VGZS8NUzVTdQh9o64bM2weCnt8Rjo0WqQReB0Gvna8jrxNwxRStmY5eKP/t31tqz0rSpM2Ew4oy7A1vPrgM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1714178776; c=relaxed/simple; bh=TheoXQXbGZE5AkcfY8FQnEeobbAUTTleYhqAU0j3JrM=; h=Date:From:To:Subject:Message-ID:MIME-Version; b=GDlW2DhsUrIzMwqR6g85kizt9OAOLHV/larVuJj8UqWO71vXWfWqgBEc3o4OgJXFHmk7Cg+Sj9FpDEe/uDsGON4U7Ucc1zTriYgjeoHSOsGvQSV7VgFn0JyMyypZMYHu9jAMSbzJafO0zTuZYinGtrx7Uf2B8I4J2lRgmOl38cE= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by arjuna.pair.com (Postfix, from userid 3006) id 4E0408A753; Fri, 26 Apr 2024 20:46:14 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by arjuna.pair.com (Postfix) with ESMTP id 4D5208A701; Fri, 26 Apr 2024 20:46:14 -0400 (EDT) Date: Fri, 26 Apr 2024 20:46:14 -0400 (EDT) From: Hans-Peter Nilsson X-X-Sender: hp@arjuna.pair.com To: Nick Clifton cc: hjl.tools@gmail.com, binutils@sourceware.org, siddhesh@redhat.com Subject: Re: RFC: ld: Add --text-section-ordering-file (version 2) In-Reply-To: Message-ID: References: <87edat7g1e.fsf@redhat.com> User-Agent: Alpine 2.20.16 (BSF 172 2016-09-29) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Scanned-By: mailmunge 3.11 on 209.68.5.131 X-Spam-Status: No, score=-3.9 required=5.0 tests=BAYES_00,KAM_DMARC_STATUS,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Fri, 26 Apr 2024, Nick Clifton wrote: > Hi Hans-Peter, > > > Sounds great! ...except: > > > > > match. So ".t*t" would match any section starting with ".t" and > > > ending with "t" and would put it into the .text section. In this > > > version however the output section is selected based upon matching > > > the fixed part at the start of the pattern with the output section. > > > So ".t*t" would only work if the output section was called ".t". > > > > Do you mean '...if the output section was called ".tt"'? Else, > > having a pattern .t*t matching an instance .t sounds confusing. > > No. Basically the code compares each entry in the section ordering file > with the name of the output section that is currently being processed. > So if the output section is called ".text" then any entry in the ordering > file that starts with ".text" will be considered as valid for this section. > But this is a straight string comparison operation, not a regular expression > match. So an entry for ".t*t" would not match an output section called > ".text". > > Now if the output section was called ".t" then this would match the ".t*t" > entry (and all of the .text. entries that might be in the ordering > file). Which would probably cause the ordering file not to work the way that > the user wants. But since this only works if the linker script has allowed > ordering in the .t section, the user would have to deliberately create a > strange linker script, eg: > > SECTIONS > { > .t : { INCLUDE section-ordering-file ; *(.t) } > .text { INCLUDE section-ordering-file ; *(.text) } > } > > I hope that this makes sense. :-) Honestly, no. Sorry. But feel free to ignore my ignorance. I just hope my confusion makes sense to the wider audience. I don't think ".t*t" should match ".t" but that it should match ".text" and ".tt". I'm certainly not going to insist. brgds, H-P