mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-24 04:00:07 +08:00
[AARCH64]Fix "align directive causes MAP_DATA symbol to be lost"
gas/ChangeLog: 2015-03-25 Renlin Li <renlin.li@arm.com> * config/tc-aarch64.c (mapping_state): Remove first MAP_DATA emitting code. (mapping_state_2): Emit first MAP_DATA symbol here.
This commit is contained in:
@ -1,3 +1,9 @@
|
|||||||
|
2015-03-25 Renlin Li <renlin.li@arm.com>
|
||||||
|
|
||||||
|
* config/tc-aarch64.c (mapping_state): Remove first MAP_DATA emitting
|
||||||
|
code.
|
||||||
|
(mapping_state_2): Emit first MAP_DATA symbol here.
|
||||||
|
|
||||||
2015-03-24 H.J. Lu <hongjiu.lu@intel.com>
|
2015-03-24 H.J. Lu <hongjiu.lu@intel.com>
|
||||||
|
|
||||||
PR gas/18087
|
PR gas/18087
|
||||||
|
@ -1467,13 +1467,12 @@ static void mapping_state_2 (enum mstate state, int max_chars);
|
|||||||
/* Set the mapping state to STATE. Only call this when about to
|
/* Set the mapping state to STATE. Only call this when about to
|
||||||
emit some STATE bytes to the file. */
|
emit some STATE bytes to the file. */
|
||||||
|
|
||||||
|
#define TRANSITION(from, to) (mapstate == (from) && state == (to))
|
||||||
void
|
void
|
||||||
mapping_state (enum mstate state)
|
mapping_state (enum mstate state)
|
||||||
{
|
{
|
||||||
enum mstate mapstate = seg_info (now_seg)->tc_segment_info_data.mapstate;
|
enum mstate mapstate = seg_info (now_seg)->tc_segment_info_data.mapstate;
|
||||||
|
|
||||||
#define TRANSITION(from, to) (mapstate == (from) && state == (to))
|
|
||||||
|
|
||||||
if (mapstate == state)
|
if (mapstate == state)
|
||||||
/* The mapping symbol has already been emitted.
|
/* The mapping symbol has already been emitted.
|
||||||
There is nothing else to do. */
|
There is nothing else to do. */
|
||||||
@ -1488,22 +1487,8 @@ mapping_state (enum mstate state)
|
|||||||
if (TRANSITION (MAP_UNDEFINED, MAP_DATA))
|
if (TRANSITION (MAP_UNDEFINED, MAP_DATA))
|
||||||
/* This case will be evaluated later in the next else. */
|
/* This case will be evaluated later in the next else. */
|
||||||
return;
|
return;
|
||||||
else if (TRANSITION (MAP_UNDEFINED, MAP_INSN))
|
|
||||||
{
|
|
||||||
/* Only add the symbol if the offset is > 0:
|
|
||||||
if we're at the first frag, check it's size > 0;
|
|
||||||
if we're not at the first frag, then for sure
|
|
||||||
the offset is > 0. */
|
|
||||||
struct frag *const frag_first = seg_info (now_seg)->frchainP->frch_root;
|
|
||||||
const int add_symbol = (frag_now != frag_first)
|
|
||||||
|| (frag_now_fix () > 0);
|
|
||||||
|
|
||||||
if (add_symbol)
|
|
||||||
make_mapping_symbol (MAP_DATA, (valueT) 0, frag_first);
|
|
||||||
}
|
|
||||||
|
|
||||||
mapping_state_2 (state, 0);
|
mapping_state_2 (state, 0);
|
||||||
#undef TRANSITION
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Same as mapping_state, but MAX_CHARS bytes have already been
|
/* Same as mapping_state, but MAX_CHARS bytes have already been
|
||||||
@ -1522,9 +1507,24 @@ mapping_state_2 (enum mstate state, int max_chars)
|
|||||||
There is nothing else to do. */
|
There is nothing else to do. */
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (TRANSITION (MAP_UNDEFINED, MAP_INSN))
|
||||||
|
{
|
||||||
|
/* Only add the symbol if the offset is > 0:
|
||||||
|
if we're at the first frag, check it's size > 0;
|
||||||
|
if we're not at the first frag, then for sure
|
||||||
|
the offset is > 0. */
|
||||||
|
struct frag *const frag_first = seg_info (now_seg)->frchainP->frch_root;
|
||||||
|
const int add_symbol = (frag_now != frag_first)
|
||||||
|
|| (frag_now_fix () > 0);
|
||||||
|
|
||||||
|
if (add_symbol)
|
||||||
|
make_mapping_symbol (MAP_DATA, (valueT) 0, frag_first);
|
||||||
|
}
|
||||||
|
|
||||||
seg_info (now_seg)->tc_segment_info_data.mapstate = state;
|
seg_info (now_seg)->tc_segment_info_data.mapstate = state;
|
||||||
make_mapping_symbol (state, (valueT) frag_now_fix () - max_chars, frag_now);
|
make_mapping_symbol (state, (valueT) frag_now_fix () - max_chars, frag_now);
|
||||||
}
|
}
|
||||||
|
#undef TRANSITION
|
||||||
#else
|
#else
|
||||||
#define mapping_state(x) /* nothing */
|
#define mapping_state(x) /* nothing */
|
||||||
#define mapping_state_2(x, y) /* nothing */
|
#define mapping_state_2(x, y) /* nothing */
|
||||||
|
Reference in New Issue
Block a user