[Xtensa] make ld preserve .org placement
Bob Wilson
bwilson@tensilica.com
Mon Jun 11 16:51:00 GMT 2007
The Xtensa port of ld does link-time relaxations that can change the
position of code that was specified with a .org directive. This
patch fixes the problem by marking the contents of a section prior to
the .org directive so that it won't be transformed by the linker.
Most of this change is just renaming the "NO_TRANSFORM" flag, since
it used to apply only to instructions but is now more general.
Tested with an xtensa-elf build and committed.
2007-06-11 Sterling Augustine <sterling@tensilica.com>
Bob Wilson <bob.wilson@acm.org>
bfd/
* elf32-xtensa.c (extend_ebb_bounds_forward): Use renamed
XTENSA_PROP_NO_TRANSFORM flag instead of
XTENSA_PROP_INSN_NO_TRANSFORM.
(extend_ebb_bounds_backward, compute_text_actions): Likewise.
(compute_ebb_proposed_actions, coalesce_shared_literal):
Likewise.
(xtensa_get_property_predef_flags): Likewise.
(compute_removed_literals): Pass new arguments to
is_removable_literal.
(is_removable_literal): Add sec, prop_table and ptblsize
arguments.
Do not remove literal if the NO_TRANSFORM property flag is set.
gas/
* config/tc-xtensa.c (XTENSA_PROP_INSN_NO_TRANSFORM):
Renamed to...
(XTENSA_PROP_NO_TRANSFORM): ...this.
(frag_flags_struct): Move is_no_transform out of the insn
sub-struct.
(xtensa_mark_frags_for_org): New.
(xtensa_handle_align): Set RELAX_ORG frag subtype for rs_org.
(xtensa_post_relax_hook): Call xtensa_mark_frags_for_org.
(get_frag_property_flags): Adjust reference to
is_no_transform flag.
(xtensa_frag_flags_combinable): Likewise.
(frag_flags_to_number): Likewise. Use
XTENSA_PROP_NO_TRANSFORM.
* config/tc-xtensa.h (xtensa_relax_statesE): Add RELAX_ORG.
include/elf/
* xtensa.h (XTENSA_PROP_INSN_NO_TRANSFORM): Renamed to...
(XTENSA_PROP_NO_TRANSFORM): ...this.
ld/
* emultempl/xtensaelf.em (replace_insn_sec_with_prop_sec):
Use renamed
XTENSA_PROP_NO_TRANSFORM flag instead of
XTENSA_PROP_INSN_NO_TRANSFORM.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: binutils-org.patch
Type: application/octet-stream
Size: 12398 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20070611/421b32dd/attachment.obj>
More information about the Binutils
mailing list