diff options
author | Nick Clifton <nickc@redhat.com> | 2011-05-17 16:02:31 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2011-05-17 16:02:31 +0000 |
commit | 84bff83f799013476b466a24f8eb639dc4e16a77 (patch) | |
tree | 3c1b7ca0f9dedbe4b38c62adccef85d36c395bde /bfd/elf32-rx.c | |
parent | 393eab54507ddd97a857a97ab8d3300ad63edb9c (diff) | |
download | gdb-84bff83f799013476b466a24f8eb639dc4e16a77.zip gdb-84bff83f799013476b466a24f8eb639dc4e16a77.tar.gz gdb-84bff83f799013476b466a24f8eb639dc4e16a77.tar.bz2 |
PR ld/12759
* emultempl/rxelf.em (ignore_lma): New variable.
(rx_elf_create_output_section_statements): Pass the setiing of
ignore_lma to bfd_elf32_rx_set_target_flags.
(OPTION_IGNORE_LMA): Define.
(OPTION_NO_IGNORE_LMA): Define.
(PARSE_AND_LIST_LONGOPTS): Add ignore lma.
(PARSE_AND_LIST_OPTIONS): Add ignore lma.
(PARSE_AND_LIST_ARGS_CASES): Add ignore lma.
* elf32-rx.c (ignore_lma): New variable.
(bfd_elf32_rx_set_target_flags): Add ignore_lma parameter.
(rx_modify_program_headers): Only copy the LMA into the VMA if
ignore_lma is true.
Diffstat (limited to 'bfd/elf32-rx.c')
-rw-r--r-- | bfd/elf32-rx.c | 37 |
1 files changed, 21 insertions, 16 deletions
diff --git a/bfd/elf32-rx.c b/bfd/elf32-rx.c index 55f2eaa..5691ced 100644 --- a/bfd/elf32-rx.c +++ b/bfd/elf32-rx.c @@ -2855,13 +2855,16 @@ rx_elf_set_private_flags (bfd * abfd, flagword flags) } static bfd_boolean no_warn_mismatch = FALSE; +static bfd_boolean ignore_lma = TRUE; -void bfd_elf32_rx_set_target_flags (bfd_boolean); +void bfd_elf32_rx_set_target_flags (bfd_boolean, bfd_boolean); void -bfd_elf32_rx_set_target_flags (bfd_boolean user_no_warn_mismatch) +bfd_elf32_rx_set_target_flags (bfd_boolean user_no_warn_mismatch, + bfd_boolean user_ignore_lma) { no_warn_mismatch = user_no_warn_mismatch; + ignore_lma = user_ignore_lma; } /* Merge backend specific data from an object file to the output @@ -3332,22 +3335,24 @@ elf32_rx_modify_program_headers (bfd * abfd ATTRIBUTE_UNUSED, phdr = tdata->phdr; count = tdata->program_header_size / bed->s->sizeof_phdr; - for (i = count; i-- != 0; ) - if (phdr[i].p_type == PT_LOAD) - { - /* The Renesas tools expect p_paddr to be zero. However, - there is no other way to store the writable data in ROM for - startup initialization. So, we let the linker *think* - we're using paddr and vaddr the "usual" way, but at the - last minute we move the paddr into the vaddr (which is what - the simulator uses) and zero out paddr. Note that this - does not affect the section headers, just the program - headers. We hope. */ + if (ignore_lma) + for (i = count; i-- != 0;) + if (phdr[i].p_type == PT_LOAD) + { + /* The Renesas tools expect p_paddr to be zero. However, + there is no other way to store the writable data in ROM for + startup initialization. So, we let the linker *think* + we're using paddr and vaddr the "usual" way, but at the + last minute we move the paddr into the vaddr (which is what + the simulator uses) and zero out paddr. Note that this + does not affect the section headers, just the program + headers. We hope. */ phdr[i].p_vaddr = phdr[i].p_paddr; - /* If we zero out p_paddr, then the LMA in the section table +#if 0 /* If we zero out p_paddr, then the LMA in the section table becomes wrong. */ - /*phdr[i].p_paddr = 0;*/ - } + phdr[i].p_paddr = 0; +#endif + } return TRUE; } |