X-Original-To: alpine-user@lists.alpinelinux.org Received: from mail-wm0-f41.google.com (mail-wm0-f41.google.com [74.125.82.41]) by lists.alpinelinux.org (Postfix) with ESMTP id 55D825C0509 for ; Mon, 5 Feb 2018 12:33:20 +0000 (GMT) Received: by mail-wm0-f41.google.com with SMTP id b21so25570823wme.4 for ; Mon, 05 Feb 2018 04:33:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:content-transfer-encoding:mime-version:subject:message-id:date :to; bh=iGCioJrQoZlDwd8EDnkN78mek9XokeLYAsdsQU6uXhQ=; b=Ux4bCiGQ1r3ESruQyPAj8iTLlf15AgO4I3y1vMUZbw3l+UGmSct8F8QgVIbY+0yNF+ zwel7JbKi6ylJpg5IkU1wnEoaNw5NBVxinTV4BfiLdVtH1q5GjYtYhMj0ojZ/ZrzydlF GCBsPL/Jzau2NL/4Y8i8FkTsRtkbCApvwGNIIbAUJQ9weZm2SBf6UmsTAziNHVGsKMR+ RTZTd6mXZJr/MUV5g7MJMyusZpU/ISmQ0MSurwkKxd7WBQFTJYs07lQAZcrcZn1IIhlj hMD3BEAjAQf33bbY4WchiHKy4wukO+jv1E7wr+zOdmfbyCldOEcgwuacV9a3lLXJ9mkS Kh9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:content-transfer-encoding:mime-version :subject:message-id:date:to; bh=iGCioJrQoZlDwd8EDnkN78mek9XokeLYAsdsQU6uXhQ=; b=EKDmv7FcPJ1d3AQDhsvJ0792Dvfs1z8gEfmeQ0Gp+PGACGb+cG3JFUe4GSqWevcute kysP4qKKJftOeIsm5RhlRxgUm1l/Skmi6tMfPIL6fJw7N1g7MYtyUYQPeYcISs7oMt7x I3oraSYPwq92kTI5khemdQ2NT0E/yhIJUKdkSe3v2Bi3LPaSprSBan43UXbIsUPj7SHh tmLsmlCv4bHPb0XsmwO0PsACFUTpbC7HVQafn3b2j7fKL/lnFvePhG+y9Mnw6iwXJUPJ 17eoQt+QEF+J5TjAaG7acxDCFCQqlDyBpW0TqDESmuKZrI7+2DsWq6mu6adTmWOYmWeH Q1PA== X-Gm-Message-State: AKwxytfaIirwDn5wlVU2BHV7oh+oHiUAIFlw1EMZFz7JEMi0SMUHBBpX 8w+nfAeI9YVBzf9Nnc5FcjnwDL/P X-Google-Smtp-Source: AH8x224ZnL/F58HocnD/Wa5KB5LBoi5TgFdU2xI1xWjYyhExbFCVmuG82g9rH+E4aa8sBTvepJAPcQ== X-Received: by 10.80.134.40 with SMTP id o37mr76131735edo.62.1517833999216; Mon, 05 Feb 2018 04:33:19 -0800 (PST) Received: from [192.168.1.103] (bs-router-apm.stwon.etc.tu-bs.de. [134.169.108.250]) by smtp.gmail.com with ESMTPSA id r29sm7262397edl.82.2018.02.05.04.33.18 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Feb 2018 04:33:18 -0800 (PST) From: Vanish Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Mailinglist: alpine-user Precedence: list List-Id: Alpine Development List-Unsubscribe: List-Post: List-Help: List-Subscribe: Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: [alpine-user] Strange output in source code associated with linker symbol Message-Id: Date: Mon, 5 Feb 2018 13:33:19 +0100 To: alpine-user@lists.alpinelinux.org X-Mailer: Apple Mail (2.3273) Hi there, I'm having trouble by using symbols defined in a linker script in my = source file. In the linker script, I define symbols like: PROVIDE(_nvarea_begin =3D 0x100 000 000); . =3D _nvarea_begin; PROVIDE(_nvdata_begin =3D . ); .nvdata . : { *(.nvdata) } PROVIDE(_nvdata_end =3D . ); PROVIDE(_nvdata_size =3D SIZEOF(.nvdata)); And in a c++ source file, they are referred as: extern "C" char _nvdata_begin[]; extern "C" char _nvdata_end[]; extern "C" char _nvdata_size[]; In this case, as I learn from this site = (https://sourceware.org/binutils/docs/ld/Source-Code-Reference.html#Source= -Code-Reference), If I print the value of _nvdata_begin in the source file, it should be = 0x100 000 000 ( printf("_nvdata_begin %p", _nvdata_begin) ).=20 And for _nvdata_end and _nvdata_size, they should also be the values set = in linker script. This works fine in Ubuntu 16.04 as the output is: _nvdata_begin 0x100 000 000 _nvdata_end 0x101 000 850 _nvdata_size 0x1 000 850 But the output in Alpine (Vanilla - 3.7.0-x86_64) is very strange. It looks like: _nvdata_begin 0x564 a9f bf9 000 _nvdata_end 0x564 aa0 bf9 850 _nvdata_size 0x564 9a0 bf9 850 Every time I run the file, it gets different values (but _nvdata_end - = _nvdata_begin =3D 0x1 000 850 is always correct). When I use nm to check the symbols, all the values are correct showed: _nvdata_begin 0x100 000 000 _nvdata_end 0x101 000 850 _nvdata_size 0x1 000 850 Can someone please tells me, why this happens and how to fix it? Thanks = in advance. Regards, Yuxing --- Unsubscribe: alpine-user+unsubscribe@lists.alpinelinux.org Help: alpine-user+help@lists.alpinelinux.org ---