From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) by sourceware.org (Postfix) with ESMTPS id 7CBAC38582A9 for ; Tue, 6 Feb 2024 16:52:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7CBAC38582A9 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=gcc.gnu.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 7CBAC38582A9 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=209.85.214.174 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707238364; cv=none; b=iUcfEuY9+Q4j5w38B+ddSHJUsn9QAz5r3MsPWCZgTzcVdC+4uFtSYtIe8Zh0wSxRU2PoZb1nxmRehSUYGoXBWXzld8lCfkM1ol5WVoI2efmrzHO696sBMLjcww+ikgmrpd9aPdI5V4GtvjC6yxVqZU/6k+BSn16BB6V+QYa+5dw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707238364; c=relaxed/simple; bh=nk2COYRhAmv5bbi0h3ZNz9KzlboCSIsawt0fSzp3YvU=; h=MIME-Version:From:Date:Message-ID:Subject:To; b=eDe7xq0cHXFbp1rKuH4VUT13AAjmtDURRhQDm5RwOIb2/suq9W/jTxhG/TDszLA+lFj3jH5fbqo7SUNtHeAtjvIZjvuGNzJj/cOm9ckt/2WsuyFIFpOtyjK1jkPb/XeDGfz1EMo1Kn05GHphF39lZKkUS3QQhcK9mzNzI78LAHE= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pl1-f174.google.com with SMTP id d9443c01a7336-1d71cb97937so9991485ad.3 for ; Tue, 06 Feb 2024 08:52:42 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707238361; x=1707843161; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=IyY8N91yMG1h1jHWrKMNkbkZS9fNjvRGyadqj1X6Izg=; b=m5wUp6UBH6EOOheY2OnN3d1Z5nWd8S0jfX1xSB3kVZteWYoYOMGMebbPB9pO+YicQg FPtHMfTTenNXQexDMPoISy15N7Rxk1umescOcRHp3ikVcqrGFZQ5o1ZIar/3PqTg85Jb 486FlJG2Hp3ktKJyUnSE9XVufZX7piz1bzdJgEO66fRsXYfkPL5VWQdt5+Yyh9Ud6wA7 SO4BzTzximL6diCMZ9qSAO1VDJBMjQS6LDtlvgO/W1u9x4n0WhFnVvgiEJp7ay1ktKwh GtE5RnZuSVWdi83jIbrycPutIGKjRRruEnEIqt+ldFsphNwQhm+VjivyyXirlQoTLkBi 6z4A== X-Gm-Message-State: AOJu0YxjWtDiHrlasO3WaVKMsIFdYOwkPGfbe/ax3IRWBP6RJsAWvAge eHKkpRTn7OdrMk34PfDcSyY+ZPL5ONJqBQg3T0WoVRd+byHcB9WEfVhLMs2bMYY= X-Google-Smtp-Source: AGHT+IGxIq6yxHrfVOIWakUFN7t7M/W+6Kv9UADxqJZKURO6QzJYwCAmT4GZw7l+ZWjWsJqC/q2dcg== X-Received: by 2002:a17:902:ed42:b0:1d9:8f6e:86e8 with SMTP id y2-20020a170902ed4200b001d98f6e86e8mr1766836plb.69.1707238361267; Tue, 06 Feb 2024 08:52:41 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCV8qMYrYolHwVCbO14adOw/K6Ptlpx+VkqUPaTCKAEDAyMC0kNWU7zk0eBQ1eUCaLlLPGiN03UgO+yRqAut2MMwZHSZQygWvw== Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com. [209.85.214.169]) by smtp.gmail.com with ESMTPSA id o18-20020a17090ad25200b002965e463ee9sm1860856pjw.34.2024.02.06.08.52.41 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 06 Feb 2024 08:52:41 -0800 (PST) Received: by mail-pl1-f169.google.com with SMTP id d9443c01a7336-1d91397bd22so8776925ad.0 for ; Tue, 06 Feb 2024 08:52:41 -0800 (PST) X-Received: by 2002:a17:902:ef95:b0:1d9:9e4f:c0d5 with SMTP id iz21-20020a170902ef9500b001d99e4fc0d5mr1881149plb.40.1707238360989; Tue, 06 Feb 2024 08:52:40 -0800 (PST) MIME-Version: 1.0 References: <20240131083244.718579-1-syq@gcc.gnu.org> <2be4441c3a739fe4c3f7a83097270257c3fcd646.camel@xry111.site> <11a02e57-b292-4f1e-b879-a54ca08c2234@redhat.com> In-Reply-To: From: YunQiang Su Date: Wed, 7 Feb 2024 00:52:29 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] MIPS: support PCREL GOT access To: "Maciej W. Rozycki" Cc: Nick Clifton , Xi Ruoyao , binutils@sourceware.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,BODY_8BITS,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,KAM_DMARC_STATUS,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Maciej W. Rozycki =E4=BA=8E2024=E5=B9=B42=E6=9C=885=E6= =97=A5=E5=91=A8=E4=B8=80 21:00=E5=86=99=E9=81=93=EF=BC=9A > > On Mon, 5 Feb 2024, Nick Clifton wrote: > > > > Any idea how to write ld testcases? > > > Normal readelf/objdump can only be sure that it is linked. > > > I think that we need to execute the out objects to be sure that it ha= s no > > > problems, such as segfault etc. > > > > You can use the [isnative] test to check to see if the test > > is being run natively and then try executing the linked code. > > This will limit verification however, especially for such a target as th= e > MIPS one, usually found in embedded devices only and therefore typically > only verified in a cross-environment. I can't remember when I last run > verification with the MIPS target natively if ever. It just takes too > long for regular use, and it can obviously only cover whatever the subset > of ISA features is that the native system provides. > Yes. It is a problem, thus I try to use qemu user to run GCC testcase. In fact not yet for binutils. https://wiki.debian.org/QemuUserEmulation/GccCheckWithQemuUser > The proper way to handle such verification is to tighten the test cases. > Relocations have well-defined semantics, so you can prepare sources such > as to get reproducible output you can then match against. That means > verifying exact bit patterns in files produced, and you can arrange for > boundary cases, such as carry/borrow or overflow, to be verified where > applicable too. We have such detailed cases in our testsuite already. > In fact I am worried that we use the wrong GOT slot, and the ldso set the GOT incorrectly for use., which is not easy to test statically. Bit by bit comparison is not easy, due to that the final executables contains something from libc, which may have quite different versions. > Relying on run-time tests to crash if a relocation calculation goes wron= g > seems rather fragile to me. I can imagine errors to cancel each other fo= r > example. > Yes. We should check statically as possible as we can. > Maciej