mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-29 02:20:51 +00:00
sim: use bfd_vma when reading start addr from bfd info
Since SIM_ADDR is always 32-bit, it might truncate the address with 64-bit ELFs. Since we load that addr from the bfd, use the bfd_vma type which matches the bfd_get_start_address API.
This commit is contained in:
@@ -1769,7 +1769,7 @@ sim_create_inferior (SIM_DESC sd, struct bfd *abfd,
|
||||
{
|
||||
struct avr_sim_state *state = AVR_SIM_STATE (sd);
|
||||
SIM_CPU *cpu = STATE_CPU (sd, 0);
|
||||
SIM_ADDR addr;
|
||||
bfd_vma addr;
|
||||
|
||||
/* Set the PC. */
|
||||
if (abfd != NULL)
|
||||
|
||||
@@ -1118,7 +1118,7 @@ sim_create_inferior (SIM_DESC sd, struct bfd *abfd,
|
||||
{
|
||||
SIM_CPU *cpu = STATE_CPU (sd, 0);
|
||||
host_callback *cb = STATE_CALLBACK (sd);
|
||||
SIM_ADDR addr;
|
||||
bfd_vma addr;
|
||||
|
||||
/* Set the PC. */
|
||||
if (abfd != NULL)
|
||||
|
||||
@@ -195,7 +195,7 @@ sim_create_inferior (SIM_DESC sd, struct bfd *abfd,
|
||||
{
|
||||
SIM_CPU *current_cpu = STATE_CPU (sd, 0);
|
||||
host_callback *cb = STATE_CALLBACK (sd);
|
||||
SIM_ADDR addr;
|
||||
bfd_vma addr;
|
||||
|
||||
/* Determine the start address.
|
||||
|
||||
|
||||
@@ -974,10 +974,10 @@ sim_create_inferior (SIM_DESC sd, struct bfd *abfd,
|
||||
{
|
||||
SIM_CPU *current_cpu = STATE_CPU (sd, 0);
|
||||
host_callback *cb = STATE_CALLBACK (sd);
|
||||
SIM_ADDR addr;
|
||||
bfd_vma addr;
|
||||
|
||||
if (sd != NULL)
|
||||
addr = cris_start_address != (SIM_ADDR) -1
|
||||
addr = cris_start_address != (USI) -1
|
||||
? cris_start_address
|
||||
: (interp_start_addr != 0
|
||||
? interp_start_addr
|
||||
|
||||
@@ -182,7 +182,7 @@ sim_create_inferior (SIM_DESC sd, bfd *abfd, char * const *argv,
|
||||
{
|
||||
SIM_CPU *current_cpu = STATE_CPU (sd, 0);
|
||||
host_callback *cb = STATE_CALLBACK (sd);
|
||||
SIM_ADDR addr;
|
||||
bfd_vma addr;
|
||||
|
||||
if (abfd != NULL)
|
||||
addr = bfd_get_start_address (abfd);
|
||||
|
||||
@@ -137,7 +137,7 @@ sim_create_inferior (SIM_DESC sd, struct bfd *abfd, char * const *argv,
|
||||
{
|
||||
SIM_CPU *current_cpu = STATE_CPU (sd, 0);
|
||||
host_callback *cb = STATE_CALLBACK (sd);
|
||||
SIM_ADDR addr;
|
||||
bfd_vma addr;
|
||||
|
||||
if (abfd != NULL)
|
||||
addr = bfd_get_start_address (abfd);
|
||||
|
||||
@@ -198,7 +198,7 @@ sim_create_inferior (SIM_DESC sd, struct bfd *abfd, char * const *argv,
|
||||
{
|
||||
SIM_CPU *current_cpu = STATE_CPU (sd, 0);
|
||||
host_callback *cb = STATE_CALLBACK (sd);
|
||||
SIM_ADDR addr;
|
||||
bfd_vma addr;
|
||||
|
||||
if (abfd != NULL)
|
||||
addr = bfd_get_start_address (abfd);
|
||||
|
||||
@@ -152,7 +152,7 @@ sim_create_inferior (SIM_DESC sd, struct bfd *abfd, char * const *argv,
|
||||
{
|
||||
SIM_CPU *current_cpu = STATE_CPU (sd, 0);
|
||||
host_callback *cb = STATE_CALLBACK (sd);
|
||||
SIM_ADDR addr;
|
||||
bfd_vma addr;
|
||||
|
||||
if (abfd != NULL)
|
||||
addr = bfd_get_start_address (abfd);
|
||||
|
||||
@@ -263,7 +263,7 @@ sim_create_inferior (SIM_DESC sd, struct bfd *abfd,
|
||||
char * const *argv, char * const *envp)
|
||||
{
|
||||
SIM_CPU *current_cpu = STATE_CPU (sd, 0);
|
||||
SIM_ADDR addr;
|
||||
bfd_vma addr;
|
||||
|
||||
if (abfd != NULL)
|
||||
addr = bfd_get_start_address (abfd);
|
||||
|
||||
@@ -856,7 +856,7 @@ sim_create_inferior (SIM_DESC sd, struct bfd *prog_bfd,
|
||||
SIM_CPU *cpu = STATE_CPU (sd, 0);
|
||||
struct pru_regset *pru_cpu = PRU_SIM_CPU (cpu);
|
||||
host_callback *cb = STATE_CALLBACK (sd);
|
||||
SIM_ADDR addr;
|
||||
bfd_vma addr;
|
||||
|
||||
addr = bfd_get_start_address (prog_bfd);
|
||||
|
||||
|
||||
@@ -139,7 +139,7 @@ sim_create_inferior (SIM_DESC sd, struct bfd *abfd,
|
||||
{
|
||||
SIM_CPU *cpu = STATE_CPU (sd, 0);
|
||||
host_callback *cb = STATE_CALLBACK (sd);
|
||||
SIM_ADDR addr;
|
||||
bfd_vma addr;
|
||||
|
||||
/* Set the PC. */
|
||||
if (abfd != NULL)
|
||||
|
||||
Reference in New Issue
Block a user