From owner-freebsd-arm@freebsd.org Wed Mar 29 06:11:58 2017 Return-Path: Delivered-To: freebsd-arm@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 39CB7D23319; Wed, 29 Mar 2017 06:11:58 +0000 (UTC) (envelope-from shrikanth07@gmail.com) Received: from mail-qk0-x231.google.com (mail-qk0-x231.google.com [IPv6:2607:f8b0:400d:c09::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EE9DD67442; Wed, 29 Mar 2017 06:11:57 +0000 (UTC) (envelope-from shrikanth07@gmail.com) Received: by mail-qk0-x231.google.com with SMTP id r142so4651744qke.2; Tue, 28 Mar 2017 23:11:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=nTYPCuJs0lEF3GlEVhyQVX6O/kTafl4IKg4HomdkfXA=; b=sS6Mgx6fBeEdRIPtISGbe74uiAP/uswdxaKlffM3Wzuf9GfdzamHsxbAbGL04UzxQG uW8JTylaySDMZqOYGQL8eg2Uf3TsxDdQ3N4dwaecBOwgJL+/5M2hnVZOKwVbuYMDdhp/ VTHlds6IIK/b2cY/XRHxt6G4AngBroQE7a83zODjcNAKSldn7vUxBgYAeH+6EXiSI4co nU9wcgUQQsZjKXKbnI0J5YgDXbN5MFC5MjVG43l7Ot9Y2BjtH7OebMy50b+f2/LR+E8r X2MwXITdDqNiupevEvmmJdEzGOJhbLMP3TeAa1MQDlG2Y7m03210vZ4iule7RKQ6S+AY A9hg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=nTYPCuJs0lEF3GlEVhyQVX6O/kTafl4IKg4HomdkfXA=; b=o6a+jZUTNumbuOpbA7dLmPaiVozGHWqAJa18IU8Pb52TqZCqTXy6HhvR5e4p6BO8fG l7sTz9/fYA/fI8MXsu1So2+DmvW5SIcWXwJF15qN5/+LI8UT8xTV20ObJdFmbPKLL6CC gJ7p61zUSWM6nY3DckaUWxlFc7uP7jclJIDPFJPyTt/XUt6Elxr9LihPAd7L98QyCNq1 SqBwaluaNBwW3lKr7JpMQpts+CMNozC82bvBr7drD3EdfMw5oXC9CpNkuSH5xmoHxklO cSHgbTfVGyNfP80Vkwo5rh003OtqHzHu0OTn8vLLf6Qrsu2VleANHz2XsnL/HNfUpcPX lRpw== X-Gm-Message-State: AFeK/H2ahNvW5+zxGgk5kFInrIAZpR81sF+Wn0yL9RtAY648re7Xc2xTipCi3/mQqjACAk1/a+hHvIeZEWEsEw== X-Received: by 10.55.47.4 with SMTP id v4mr28565282qkh.77.1490767916809; Tue, 28 Mar 2017 23:11:56 -0700 (PDT) MIME-Version: 1.0 Received: by 10.140.38.146 with HTTP; Tue, 28 Mar 2017 23:11:56 -0700 (PDT) From: Shrikanth Kamath Date: Tue, 28 Mar 2017 23:11:56 -0700 Message-ID: Subject: ldscript.arm and elf section ordering To: freebsd-hackers@freebsd.org, freebsd-arm@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Mar 2017 06:11:58 -0000 Have a question around the order in which symtab/strtab/shstrtab are placed for the elf binaries. Working with two different versions of the LLVM toolchain here in Juniper, so when building FreeBSD kernel with llvm 3.5 toolchain for arm (toolchain is published from sources internally) the sections shstrtab/symtab/strtab have offsets that are in increasing order (this is skimmed output from readelf) [Nr] Name Type Addr Off Size ES Flg Lk Inf Al ... [44] .shstrtab STRTAB 00000000 ede7f2 000283 00 0 0 1 [45] .symtab SYMTAB 00000000 edf1d0 05fc40 10 46 15427 4 [46] .strtab STRTAB 00000000 f3ee10 0834a2 00 0 0 1 When building with llvm 3.7 though the offsets do not appear to be in the expected order [40] .shstrtab STRTAB 00000000 10cbdaa 000229 00 0 0 1 [41] .symtab SYMTAB 00000000 fd0520 079de0 10 42 22109 4 [42] .strtab STRTAB 00000000 104a300 081aaa 00 0 0 1 the .shstrtab offset appears to be beyond section ".strtab" and ".symtab" but in terms of section ordering .shstrtab appears before symtab and strtab. Due to some design constraint I need to investigate if we can fix the .shstrtab beyond .symtab and .strtab, query to hackers is if this is an advisable thing to do? And how should the ldscript.arm be used to reorder this. Thanks, -- Shrikanth R K