mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2026-08-27 00:26:02 -04:00
libsframe misaligned uint32_t
I saw asan complaints about misaligned loads and stores when taking a quick look at pr33810 before Jens' patch was applied. They have disappeared now, but it looks to me like a FRE can start on any address boundary and there is no padding or suchlike to align the FRE fields. * sframe.c (flip_fre_stack_offsets): Let the compiler know that integers may be misaligned.
This commit is contained in:
parent
6b04333528
commit
efcfd08547
1 changed files with 7 additions and 7 deletions
|
|
@ -402,21 +402,21 @@ flip_fre_start_address (void *addr, uint32_t fre_type)
|
|||
}
|
||||
|
||||
static void
|
||||
flip_fre_stack_offsets (char *offsets, uint8_t offset_size, uint8_t offset_cnt)
|
||||
flip_fre_stack_offsets (void *offsets, uint8_t offset_size, uint8_t offset_cnt)
|
||||
{
|
||||
int j;
|
||||
|
||||
if (offset_size == SFRAME_FRE_OFFSET_2B)
|
||||
{
|
||||
uint16_t *ust = (uint16_t *)offsets;
|
||||
for (j = offset_cnt; j > 0; ust++, j--)
|
||||
swap_thing (*ust);
|
||||
struct { uint16_t x; } ATTRIBUTE_PACKED *p = offsets;
|
||||
for (j = offset_cnt; j > 0; p++, j--)
|
||||
swap_thing (p->x);
|
||||
}
|
||||
else if (offset_size == SFRAME_FRE_OFFSET_4B)
|
||||
{
|
||||
uint32_t *uit = (uint32_t *)offsets;
|
||||
for (j = offset_cnt; j > 0; uit++, j--)
|
||||
swap_thing (*uit);
|
||||
struct { uint32_t x; } ATTRIBUTE_PACKED *p = offsets;
|
||||
for (j = offset_cnt; j > 0; p++, j--)
|
||||
swap_thing (p->x);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue