diff options
author | Nick Clifton <nickc@redhat.com> | 2016-08-05 10:37:57 +0100 |
---|---|---|
committer | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2017-08-24 09:47:34 -0300 |
commit | f7897e0c6bb3803f2603f5ebabeaffdd49b1ab77 (patch) | |
tree | 6b56b357b40f63e7c5b86d3f3fd47435a12774a0 /gas/config/tc-aarch64.c | |
parent | b031c3be16673c41531024f066bcb857be6641cc (diff) | |
download | fsf-binutils-gdb-users/linaro/binutils-2_25-branch.zip fsf-binutils-gdb-users/linaro/binutils-2_25-branch.tar.gz fsf-binutils-gdb-users/linaro/binutils-2_25-branch.tar.bz2 |
Fix the generation of alignment frags in code sections for AArch64.users/linaro/binutils-2_25-branch
PR gas/20364
* config/tc-aarch64.c (s_ltorg): Change the mapping state after
aligning the frag.
(aarch64_init): Treat rs_align frags in code sections as
containing code, not data.
* testsuite/gas/aarch64/pr20364.s: New test.
* testsuite/gas/aarch64/pr20364.d: New test driver.
Cherry-pick of 7ea12e5c3ad54da440c08f32da09534e63e515ca
Change-Id: I6bb37f33419cbf54e52c8d54ef0d1c18fdc85878
Diffstat (limited to 'gas/config/tc-aarch64.c')
-rw-r--r-- | gas/config/tc-aarch64.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/gas/config/tc-aarch64.c b/gas/config/tc-aarch64.c index 4c785a6..8a74fd1 100644 --- a/gas/config/tc-aarch64.c +++ b/gas/config/tc-aarch64.c @@ -1747,13 +1747,13 @@ s_ltorg (int ignored ATTRIBUTE_UNUSED) if (pool == NULL || pool->symbol == NULL || pool->next_free_entry == 0) continue; - mapping_state (MAP_DATA); - /* Align pool as you have word accesses. Only make a frag if we have to. */ if (!need_pass_2) frag_align (align, 0, 0); + mapping_state (MAP_DATA); + record_alignment (now_seg, align); sprintf (sym_name, "$$lit_\002%x", pool->id); @@ -5984,11 +5984,15 @@ aarch64_init_frag (fragS * fragP, int max_chars) 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: + /* PR 20364: We can get alignment frags in code sections, + so do not just assume that we should use the MAP_DATA state. */ + mapping_state_2 (subseg_text_p (now_seg) ? MAP_INSN : MAP_DATA, max_chars); + break; case rs_align_code: mapping_state_2 (MAP_INSN, max_chars); break; |