Bug 12759 - rx-elf-ld needs --no-ignore-lma
Summary: rx-elf-ld needs --no-ignore-lma
Status: RESOLVED FIXED
Alias: None
Product: binutils
Classification: Unclassified
Component: ld (show other bugs)
Version: 2.22
: P2 enhancement
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-14 08:48 UTC by Tomohiro Kashiwada
Modified: 2011-05-17 16:05 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments
patch for add --ignore-lma and --no-ignore-lma for rx-elf-ld (1.49 KB, application/octet-stream)
2011-05-14 08:48 UTC, Tomohiro Kashiwada
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tomohiro Kashiwada 2011-05-14 08:48:35 UTC
Created attachment 5722 [details]
patch for add --ignore-lma and --no-ignore-lma for rx-elf-ld

AAA ignores LMA and overrides it to VMA for Renesas Tools compatibility.
Because of this behavior, generating ROM-file(srec) by objcopy needs extra option --change-section-lma.
But --change-section-lma requires immediate value for LMA address, but I want to use symbolized value in linker-script.

So, AAA should change its behavior by command-line option "--ignore-lma" and "--no-ignore-lma" (or better name).

Attachment for proposal patch.
Comment 1 Tomohiro Kashiwada 2011-05-15 04:59:29 UTC
paste miss... s/AAA/rx-elf-ld/g


> rx-elf-ld ignores LMA and overrides it to VMA for Renesas Tools compatibility.

> So, rx-elf-ld should change its behavior by command-line option "--ignore-lma" and
Comment 2 cvs-commit@gcc.gnu.org 2011-05-17 16:02:35 UTC
CVSROOT:	/cvs/src
Module name:	src
Changes by:	nickc@sourceware.org	2011-05-17 16:02:31

Modified files:
	ld             : ChangeLog 
	ld/emultempl   : rxelf.em 
	bfd            : ChangeLog elf32-rx.c 

Log message:
	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.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/ChangeLog.diff?cvsroot=src&r1=1.2335&r2=1.2336
http://sourceware.org/cgi-bin/cvsweb.cgi/src/ld/emultempl/rxelf.em.diff?cvsroot=src&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/src/bfd/ChangeLog.diff?cvsroot=src&r1=1.5345&r2=1.5346
http://sourceware.org/cgi-bin/cvsweb.cgi/src/bfd/elf32-rx.c.diff?cvsroot=src&r1=1.9&r2=1.10
Comment 3 Nick Clifton 2011-05-17 16:05:00 UTC
Hi Tomohiro-san,

  Thanks for submitting this patch.  I have checked it in along with these
changelog entries.

Cheers
  Nick

bfd/ChangeLog
2011-05-17  Tomohiro Kashiwada  <kikairoya@gmail.com>

    PR ld/12759
    * 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.

ld/ChangeLog
2011-05-17  Tomohiro Kashiwada  <kikairoya@gmail.com>

    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.