From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 81317 invoked by alias); 6 Jul 2017 14:22:24 -0000 Mailing-List: contact newlib-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: newlib-owner@sourceware.org Received: (qmail 81271 invoked by uid 89); 6 Jul 2017 14:22:22 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.1 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=H*f:sk:87bmoy5, H*i:sk:87bmoy5 X-HELO: EUR01-DB5-obe.outbound.protection.outlook.com Received: from mail-db5eur01on0073.outbound.protection.outlook.com (HELO EUR01-DB5-obe.outbound.protection.outlook.com) (104.47.2.73) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 06 Jul 2017 14:21:41 +0000 Received: from VI1PR0801MB2031.eurprd08.prod.outlook.com (10.173.74.140) by VI1PR0801MB2032.eurprd08.prod.outlook.com (10.173.74.141) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1220.11; Thu, 6 Jul 2017 14:21:36 +0000 Received: from VI1PR0801MB2031.eurprd08.prod.outlook.com ([fe80::a9ee:7f10:b6a1:339a]) by VI1PR0801MB2031.eurprd08.prod.outlook.com ([fe80::a9ee:7f10:b6a1:339a%18]) with mapi id 15.01.1220.018; Thu, 6 Jul 2017 14:21:36 +0000 From: Tamar Christina To: Senthil Kumar Selvaraj , Dave Nadler CC: "newlib@sourceware.org" , nd Subject: RE: [Newlib][libgloss]ARM - semihosting use of __end__symbol in crt0.S Date: Thu, 06 Jul 2017 14:22:00 -0000 Message-ID: References: <20170705083621.GB30902@calimero.vinschen.de> <3194afba-248d-a10e-1393-91bfbe744d43@nadler.com> <91886142-6bd1-54cd-6bc7-3f00569a3e60@nadler.com> <87bmoy5g9s.fsf@microchip.com> In-Reply-To: <87bmoy5g9s.fsf@microchip.com> authentication-results: microchip.com; dkim=none (message not signed) header.d=none;microchip.com; dmarc=none action=none header.from=arm.com; x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;VI1PR0801MB2032;7:XLxBvzXWplEgcIWPXW8JU1RpFzAgm07mvBBl+78odP53L+nFqxRWKUcXZa5Fg28LXw6BiM/L4SwdmLg403tS54w9KrgvmUaTvEWMJCEx5O1C6R1Lxn0nbnvpY7uXepzJEoCbxBpcYvvz7pYvcS3Uld7XvTQaoXYSFknB1uKDEekMaW+Wud2FjVZahOkCsqODuBtQS2DPKUvHdqKB0GOM+CCZobrIH7Y94fbeKPoy0/FMdwCSOJIPIYYs72WQqcX4PZ3DX64kX3pFpuEf3BZ84zQRhAWP65rFjP64/izkyi0nVTnwGOfeSMhpa2J5HedJ5jp5MFPOlXIgPbFkrsK8nP8afU75aLMezTfzuJPzzHQaO91P3Pbx3wo5A/vSU6hQMSAYgSqLLVTkEeR5Q/kdwnK76sfOHBQFSp8bnbaK5bdJlrkGJ+MxYRiLoQQpNLDGyzPplHGiSuLcdYCaXe19wTcQ1kC/vm2yUCokHZ2JQL7ghgTzJPUNLgwQun8FgwtzU5y9WNAHFPpMrlJ4HsLr1oj9xQyfVerIeLSM8cSkeJjgnYTePigr0IakGOtV4EFEESMQSoXW2S4ygvjXAOoiDqJ6q74FEmn4uoIQa3CfET5lpImjou/jNFYtvIiMOJ2L4vc/gzWSxcvtFS9pnQY+fIDmV2ss8qNphhR0bLo0Tff3WXAMyb3hCAys/VqO2K49iorQaWKx7uRejqPQxY7A/+LmiqxL1dsimAo6WhqYFxuew0RQCW0JUAYHavjtU0JW230zvjUZ1ghljnvLD+iBjHw0GzDFWR4wBLzXigfNXc4= x-ms-office365-filtering-correlation-id: 3189471b-7eff-4b5f-8f44-08d4c47a4f97 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254075)(48565401081)(300000503095)(300135400095)(2017052603031)(201703131423075)(201703031133081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:VI1PR0801MB2032; x-ms-traffictypediagnostic: VI1PR0801MB2032: nodisclaimer: True x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(180628864354917)(236129657087228)(185212123834332); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(5005006)(8121501046)(2017060910048)(93006095)(93001095)(3002001)(10201501046)(100000703101)(100105400095)(6055026)(6041248)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(20161123555025)(20161123562025)(20161123564025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:VI1PR0801MB2032;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:VI1PR0801MB2032; x-forefront-prvs: 03607C04F0 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(6009001)(39410400002)(39840400002)(39860400002)(39850400002)(39450400003)(39400400002)(24454002)(51874003)(377454003)(2900100001)(1720100001)(9686003)(7696004)(229853002)(81166006)(8676002)(3280700002)(2950100002)(3660700001)(25786009)(93886004)(38730400002)(54906002)(6506006)(5250100002)(6436002)(55016002)(6306002)(305945005)(74316002)(4326008)(7736002)(5660300001)(53936002)(6246003)(99286003)(50986999)(86362001)(3846002)(6116002)(102836003)(53546010)(8936002)(76176999)(54356999)(14454004)(2906002)(189998001)(966005)(478600001)(72206003)(66066001)(33656002);DIR:OUT;SFP:1101;SCL:1;SRVR:VI1PR0801MB2032;H:VI1PR0801MB2031.eurprd08.prod.outlook.com;FPR:;SPF:None;MLV:sfv;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Jul 2017 14:21:36.4938 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0801MB2032 X-IsSubscribed: yes X-SW-Source: 2017/txt/msg00574.txt.bz2 >=20 > Dave Nadler writes: >=20 > > Thanks Tamar - but, what is the heap base address _used_ for in > semihosting? > > > IIRC, the sbrk system call implementation in libnosys uses it, not sure a= bout > rdimon. >=20 > Regards > Senthil >=20 > > The heap storage is allocated starting during early start-up; so > > hopefully it is not trying to use this memory... Our default implementations don't use this for anything, it just makes it a= vailable. The sbrk implementation in rdimon only uses __heap_limit from the SYS_HEAPI= NFO call. That said the sbrk implementation is currently using "end" as the heap base. > > > > Thanks! > > Best Regards, Dave > > > > On 7/5/2017 11:16 AM, Tamar Christina wrote: > >> Hi Dave, > >> > >> The use of __end__ relates to the semihosting call SYS_HEAPINFO. > >> Likely the link originally pointed > tohttp://infocenter.arm.com/help/index.jsp?topic=3D/com.arm.doc.dui0471f/ > Bacbefaa.html. > >> > >> Basically at the startup r0 will contain the given 4 byte structure, w= here > the first entry is the heap_base. > >> If this is 0 it means the system was unable to calculate it. > >> __end__ is then used as a fall back for this. > >> The reason __end__ is used instead of __bss_end___ has to do with the > alignment requirements. > >> > >> The same question was asked on the bug-fix patch that introduced it: > >> http://newlib.sourceware.narkive.com/bcyUamAh/rfa-libgloss-arm- > handle > >> -zero-heap-base-from-semihosting > >> > >> I am not completely certain, but this seems to indicate that not all of > semihosting is supported on systems with multiple stacks. > >> > >> Cheers, > >> Tamar > >> ________________________________________ > >> From: Dave Nadler > >> Sent: Wednesday, July 5, 2017 2:32:18 PM > >> To: Tamar Christina;newlib@sourceware.org > >> Cc: nd > >> Subject: [Newlib][libgloss]ARM - semihosting use of __end__symbol in > >> crt0.S > >> > >> Hi Tamar - Perhaps as you are working on ARM crt0 and semihosting, > >> you can help with a question regarding crt0's use of the symbol > >> __end__ for semihosting. > >> I read the code but I'm not expert at ARM assembly and do not > >> understand what __end__ is being used for, and the comments do not > >> explain the intent/purpose... > >> > >> I am concerned that there is an assumption within semihosting about > >> available memory or memory boundaries that may be incorrect in > >> systems where heap and stack are not contiguous, for example > embedded > >> systems with multiple stacks. > >> > >> I asked the question on stack exchange but (surprise) didn't get any > >> useful response: > >> https://stackoverflow.com/questions/44853442/meaning-of-gnu-symbol- > en > >> d-especially-arm-embedded > >> > >> Thanks in advance for any clarification, Best Regards, Dave