/* Main simulator entry points specific to the CRIS.
- Copyright (C) 2004-2016 Free Software Foundation, Inc.
+ Copyright (C) 2004-2020 Free Software Foundation, Inc.
Contributed by Axis Communications.
This file is part of the GNU simulators.
SIM_DESC sd = p->sd;
int offset = p->offset;
- if ((bfd_get_section_flags (abfd, s) & SEC_ALLOC))
+ if ((bfd_section_flags (s) & SEC_ALLOC))
{
- bfd_vma vma = bfd_get_section_vma (abfd, s);
+ bfd_vma vma = bfd_section_vma (s);
- bfd_set_section_vma (abfd, s, vma + offset);
+ bfd_set_section_vma (s, vma + offset);
}
/* This seems clumsy and inaccurate, but let's stick to doing it the
same way as sim_analyze_program for consistency. */
- if (strcmp (bfd_get_section_name (abfd, s), ".text") == 0)
- STATE_TEXT_START (sd) = bfd_get_section_vma (abfd, s);
+ if (strcmp (bfd_section_name (s), ".text") == 0)
+ STATE_TEXT_START (sd) = bfd_section_vma (s);
}
/* Adjust the start-address, LMA and VMA of a SD. Must be called
{
struct progbounds *pbp = (struct progbounds *) vp;
- if ((bfd_get_section_flags (abfd, s) & SEC_ALLOC))
+ if ((bfd_section_flags (s) & SEC_ALLOC))
{
- bfd_size_type sec_size = bfd_get_section_size (s);
- bfd_size_type sec_start = bfd_get_section_vma (abfd, s);
+ bfd_size_type sec_size = bfd_section_size (s);
+ bfd_size_type sec_start = bfd_section_vma (s);
bfd_size_type sec_end = sec_start + sec_size;
if (sec_end > pbp->endmem)
if (sec_start < pbp->startmem)
pbp->startmem = sec_start;
- if ((bfd_get_section_flags (abfd, s) & SEC_LOAD))
+ if ((bfd_section_flags (s) & SEC_LOAD))
{
if (sec_end > pbp->end_loadmem)
pbp->end_loadmem = sec_end;
SIM_DESC
sim_open (SIM_OPEN_KIND kind, host_callback *callback, struct bfd *abfd,
- char **argv)
+ char * const *argv)
{
char c;
int i;
return 0;
}
- /* getopt will print the error message so we just have to exit if this fails.
- FIXME: Hmmm... in the case of gdb we need getopt to call
- print_filtered. */
+ /* The parser will print an error message for us, so we silently return. */
if (sim_parse_args (sd, argv) != SIM_RC_OK)
{
free_state (sd);
specified. */
if (abfd != NULL && !cris_bare_iron)
{
- char *name = bfd_get_filename (abfd);
+ const char *name = bfd_get_filename (abfd);
char **my_environ = GET_ENVIRON ();
/* We use these maps to give the same behavior as the old xsim
simulator. */
/* Note that the linux kernel does not correctly compute the storage
needs for the static-exe AUX vector. */
- csp -= sizeof (auxv_entries) / sizeof (auxv_entries[0]) * 4 * 2;
+ csp -= ARRAY_SIZE (auxv_entries) * 4 * 2;
csp -= (envc + 1) * 4;
csp -= (my_argc + 1) * 4;
goto abandon_chip;
if (bfd_get_flavour (abfd) == bfd_target_elf_flavour)
- for (i = 0; i < sizeof (auxv_entries) / sizeof (auxv_entries[0]); i++)
+ for (i = 0; i < ARRAY_SIZE (auxv_entries); i++)
{
write_dword (csp, auxv_entries[i].id);
write_dword (csp + 4,
\f
SIM_RC
sim_create_inferior (SIM_DESC sd, struct bfd *abfd,
- char **argv ATTRIBUTE_UNUSED,
- char **envp ATTRIBUTE_UNUSED)
+ char * const *argv ATTRIBUTE_UNUSED,
+ char * const *envp ATTRIBUTE_UNUSED)
{
SIM_CPU *current_cpu = STATE_CPU (sd, 0);
SIM_ADDR addr;