From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-x634.google.com (mail-ej1-x634.google.com [IPv6:2a00:1450:4864:20::634]) by sourceware.org (Postfix) with ESMTPS id EE00638582B6 for ; Sun, 28 Aug 2022 06:41:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org EE00638582B6 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ej1-x634.google.com with SMTP id og21so10075316ejc.2 for ; Sat, 27 Aug 2022 23:41:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc; bh=2JGaBscmuaAbpkBu35Jp7kiScBOaVQfIhN5vtI231Qk=; b=QFH81naLs2dXoqMG9nuLsvKJr51fLs4FRTZ2RQbN+uv846ob53tof5YR5v2izyORgu aocHtR0CTEQCnb+xffw1uDJ19RgOf9tLGz75plVvJ0vP2V3hyH3ySGJpsnS7dNHyosq8 5woZswwGMlxVR+cf/eq6tjcZf1i3QqGDgLKq3HKQBIY2lUrfEADiYrf0wHbYAXAUXQ+T 9soU5/MwbVja7ckyqRqYgY8NN9+pgZdiBmY15ToBy50psAEim2NldfI7r9pnKiZbGYBd z/41FIQaiJhPrF2Wd7TF+DJ27RnCReeUlIB3BfNaM8J78EiuMqUfARACr2FD2BYfAbX9 fKog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc; bh=2JGaBscmuaAbpkBu35Jp7kiScBOaVQfIhN5vtI231Qk=; b=vH9hbRn+XAy2bI0cNh/HbIXDu4ZqX9U9eMd7HjRouqx8ZcQqa5cSGJCEN8CH7/JIrx 1KXD0bdpvElzGhzfJTysYrOZgwptAI/s+12KUhLRKB2lQFUlqmh/15V1s/BgVvXpefNi KNH1GfP7mZ1pLtEvbO+jaeJRqaJlhPrD8FsCmqFyYlYR4u4piZoVI1wWUPKypazuj9Va qlJVHABk5XvdThUMqwoWgSoWK1vRPWGbwQtbw8Ogb0qcR3FMdHFg8wWHeNbyfiXqZT9S TmUQk1/T74uVAzkKVuSbBfa6MXjcktxbFyxJMi8MICtIWgiuBXA0tsDz1jWNIAoaO0Mj 76lA== X-Gm-Message-State: ACgBeo2jvMYI8LiCmyH8hvAzMAlCkgKbFVDrAxNkA2aX37koI0dtTyYU zLxrDxt/1GcKnWkqXoT7ujtJnSpfWysrBc4JCjA= X-Google-Smtp-Source: AA6agR5jeUIgMSi/A2eJ5Wg0swT4E3Qc6EDXURAF3j12teWKVhebW2V3KO1QNX/JM9WN2SgyMjAmw5pi1pmIeg7xVXg= X-Received: by 2002:a17:907:6ea7:b0:731:7ef9:dbfa with SMTP id sh39-20020a1709076ea700b007317ef9dbfamr10350710ejc.146.1661668871440; Sat, 27 Aug 2022 23:41:11 -0700 (PDT) MIME-Version: 1.0 References: <2825590.45ddzSUfD6@milian-workstation> <2563495.X3S6A8DOgW@milian-workstation> <198e9e0414a04b741baa865c856534a6171504c9.camel@klomp.org> In-Reply-To: <198e9e0414a04b741baa865c856534a6171504c9.camel@klomp.org> From: Jacob Burkholder Date: Sat, 27 Aug 2022 23:41:00 -0700 Message-ID: Subject: Re: runtime validation of DT_SYMTAB lookups - why is there no DT_SYMSZ? To: Mark Wielaard Cc: Milian Wolff , elfutils-devel@sourceware.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-0.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE 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: I've always used the fact that the symbol table and string table are present in the binary in that order and adjacent to each other to find the number of symbol table entries., ie (strtab - (char *)symtab) / sizeof(*symtab), although clearly this is not required and may just be gnu ld convention. DT_SYMSZ would be a useful addition to the ELF standard IMO.