From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7764 invoked by alias); 17 Jun 2015 09:39:03 -0000 Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org Received: (qmail 7751 invoked by uid 89); 17 Jun 2015 09:39:02 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00,SPF_PASS autolearn=ham version=3.3.2 X-HELO: eu-smtp-delivery-143.mimecast.com Received: from eu-smtp-delivery-143.mimecast.com (HELO eu-smtp-delivery-143.mimecast.com) (207.82.80.143) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 17 Jun 2015 09:39:00 +0000 Received: from cam-owa1.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.140]) by uk-mta-36.uk.mimecast.lan; Wed, 17 Jun 2015 10:38:57 +0100 Received: from [10.2.207.43] ([10.1.2.79]) by cam-owa1.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 17 Jun 2015 10:38:57 +0100 Message-ID: <55814031.2010000@arm.com> Date: Wed, 17 Jun 2015 09:39:00 -0000 From: Renlin Li User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: "binutils@sourceware.org" CC: Nicholas Clifton , Marcus Shawcroft Subject: [2.25][AARCH64][GAS]Backport "Positively emit symbols for alignment." References: <553A3CAD.3050208@arm.com> In-Reply-To: <553A3CAD.3050208@arm.com> X-MC-Unique: afDQitSURBmsLZRqCDKZ7w-1 Content-Type: multipart/mixed; boundary="------------020709090307060601090405" X-IsSubscribed: yes X-SW-Source: 2015-06/txt/msg00174.txt.bz2 This is a multi-part message in MIME format. --------------020709090307060601090405 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Content-length: 2951 Hi all, This is a backport patch from the discussion here: https://sourceware.org/ml/binutils/2015-05/msg00027.html https://sourceware.org/ml/binutils/2015-05/msg00027.html The expected results of testcases are modified to account the status of=20 binutils 2.25. Binutils, ld, gas regression test Okay. Okay to commit for branch 2.25? Regards, Renlin Li gas/ChangeLog: 2015-06-17 Renlin Li Backport from mainline. 2015-05-05 Renlin Li * config/tc-aarch64.c (aarch64_init_frag): Always generate=20 mapping symbols. gas/testsuite/ChangeLog: 2015-06-17 Renlin Li Backport from mainline. 2015-05-05 Renlin Li * gas/aarch64/mapping_5.d: New. * gas/aarch64/mapping_5.s: New. * gas/aarch64/mapping_6.d: New. * gas/aarch64/mapping_6.s: New. On 24/04/15 13:53, Renlin Li wrote: > Hi all, > > In arm_init_frag(), when ARM or THUMB are recorded, it will simply=20 > return without doing anything. This is not correct in a few cases. > > For the following two cases: > case 1: > nop ----> MAP_ARM > .long 0 ---> MAP_DATA > .align 4 ---> > ---->(1) > ----> start new frag > .word 0x12345678 > > (1) paddings here are all treated as data, because the previous state=20 > is MAP_DATA. > > case 2: > nop ----> MAP_ARM > .long 0 ---> MAP_DATA > .byte 1 > .align 2 ---> (1) > ----> (2) > ----> start new frag > .long 0x12345678 ----> (3) > > stage 1: while parsing the input file: > (1) arm_init_frag early returns, No state change, no new symbol. (3)No=20 > state change, no new symbol. > stage 2: Later, while writing the object file: > (2)MAP_DATA, MAP_ARM are inserted by insert_data_mapping_symol to=20 > handle alignment. (3) interpreted as instruction because of the=20 > MAP_ARM inserted at (2) > > > This change might generate redundant symbols, some of them can be=20 > removed later. In check_mapping_symbols(), the symbols at the end of a=20 > section, and overlapping symbols will be removed. > > gas checked without any new issues. Okay to commit? > > By the way, Nick, aarch64 has the same issue. The same can be done to=20 > aarch64_init_frag(). Another way is to remove=20 > fragP->tc_frag_data.recorded. It's only used in a few places. But I am=20 > sure what dose it intended to do, Could you please explain a little=20 > bit for me? > > Regards, > Renlin Li > > > gas/ChangeLog: > > 2015-04-24 Renlin Li > > * config/tc-arm.c (arm_init_frag): Always emit mapping symbols. > > gas/testsuite/ChangeLog: > > 2015-04-24 Renlin Li > > * gas/arm/thumb2_vpool_be.d: Adjust the desired output. > * gas/arm/vldconst_be.d: Ditto. > --------------020709090307060601090405 Content-Type: text/x-patch; name=aarch64-backport.diff Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="aarch64-backport.diff" Content-length: 2992 commit 262a89bcf8dd349e065d46896965c49054c8a034 Author: Renlin Li Date: Wed Jun 3 16:34:10 2015 +0100 aarch64 backport =20=20=20=20 Change-Id: Ie8d550c3518a25de0094fe7dc7bcfecd1ac77356 diff --git a/gas/config/tc-aarch64.c b/gas/config/tc-aarch64.c index 62a1a3f..015b0b7 100644 --- a/gas/config/tc-aarch64.c +++ b/gas/config/tc-aarch64.c @@ -5914,21 +5914,20 @@ aarch64_init_frag (fragS * fragP, int max_chars) /* Record a mapping symbol for alignment frags. We will delete this later if the alignment ends up empty. */ if (!fragP->tc_frag_data.recorded) + fragP->tc_frag_data.recorded =3D 1; + + switch (fragP->fr_type) { - fragP->tc_frag_data.recorded =3D 1; - switch (fragP->fr_type) - { - case rs_align: - case rs_align_test: - case rs_fill: - mapping_state_2 (MAP_DATA, max_chars); - break; - case rs_align_code: - mapping_state_2 (MAP_INSN, max_chars); - break; - default: - break; - } + case rs_align: + case rs_align_test: + case rs_fill: + mapping_state_2 (MAP_DATA, max_chars); + break; + case rs_align_code: + mapping_state_2 (MAP_INSN, max_chars); + break; + default: + break; } } =0C diff --git a/gas/testsuite/gas/aarch64/mapping_5.d b/gas/testsuite/gas/aarc= h64/mapping_5.d new file mode 100644 index 0000000..8a85038 --- /dev/null +++ b/gas/testsuite/gas/aarch64/mapping_5.d @@ -0,0 +1,14 @@ +#objdump: --syms --special-syms +#name: AArch64 Mapping Symbols Test 5 + +.*: +file format.*aarch64.* + +SYMBOL TABLE: +[0]+00 l d .text [0]+00 .text +[0]+00 l d .data [0]+00 .data +[0]+00 l d .bss [0]+00 .bss +[0]+00 l .text [0]+00 \$x +[0]+04 l .text [0]+00 \$d +[0]+08 l .text [0]+00 \$x +[0]+10 l .text [0]+00 \$d +[0]+14 l .text [0]+00 \$x diff --git a/gas/testsuite/gas/aarch64/mapping_5.s b/gas/testsuite/gas/aarc= h64/mapping_5.s new file mode 100644 index 0000000..2cb95ed --- /dev/null +++ b/gas/testsuite/gas/aarch64/mapping_5.s @@ -0,0 +1,5 @@ + .text + nop + .long 0 + .align 4 + .word 0x12345678 diff --git a/gas/testsuite/gas/aarch64/mapping_6.d b/gas/testsuite/gas/aarc= h64/mapping_6.d new file mode 100644 index 0000000..df6bdaa --- /dev/null +++ b/gas/testsuite/gas/aarch64/mapping_6.d @@ -0,0 +1,15 @@ +#objdump: --syms --special-syms +#name: AArch64 Mapping Symbols Test 6 + +.*: +file format.*aarch64.* + +SYMBOL TABLE: +[0]+00 l d .text [0]+00 .text +[0]+00 l d .data [0]+00 .data +[0]+00 l d .bss [0]+00 .bss +[0]+00 l .text [0]+00 \$x +[0]+04 l .text [0]+00 \$d +[0]+10 l .text [0]+00 \$d +[0]+14 l .text [0]+00 \$x +[0]+09 l .text [0]+00 \$d +[0]+0c l .text [0]+00 \$x diff --git a/gas/testsuite/gas/aarch64/mapping_6.s b/gas/testsuite/gas/aarc= h64/mapping_6.s new file mode 100644 index 0000000..4e0e2c5 --- /dev/null +++ b/gas/testsuite/gas/aarch64/mapping_6.s @@ -0,0 +1,6 @@ + .text + nop + .long 0 + .byte 1 + .align 4 + .word 0x12345678 --------------020709090307060601090405--