avoid putting Xtensa GOT location table in non-dynamic executables
Bob Wilson
bwilson@tensilica.com
Thu Jul 10 19:19:00 GMT 2003
Dynamic Xtensa executables and shared objects may have multiple GOT tables and
the runtime linker needs to know where they are. We use a table to identify
the GOT locations. We use an identical table to identify the locations of
constant pools in non-dynamic executables (currently used mostly to improve
disassembly output with some patches that still need to be contributed). The
difference between these is that for dynamic files the table must be included
in a loadable segment, whereas for static executables the table need not be
loaded. Until now, the table was _always_ in a loadable segment. This patch
fixes it so that the table is not loaded for static executables. It creates
a new ".got.loc" section only for dynamic links. The contents of .got.loc
are copied from the old .xt.lit section, which is now placed outside of a
loadable segment.
Tested with an xtensa-linux target and committed on the mainline.
bfd ChangeLog:
2003-07-10 Bob Wilson <bob.wilson@acm.org>
* elf32-xtensa.c (elf_xtensa_create_dynamic_sections): Create new
.got.loc section. Do not set SEC_ALLOC or SEC_LOAD flags for the
.xt.lit.plt section.
(elf_xtensa_size_dynamic_sections): Set size of the .got.loc section
and allocate memory for it.
(elf_xtensa_combine_prop_entries): Copy contents of .xt.lit output
section to the .got.loc section.
(elf_xtensa_finish_dynamic_sections): Fix up call to
elf_xtensa_combine_prop_entries and set DT_XTENSA_GOT_LOC_OFF to
the address of .got.loc.
(relax_property_section): Shrink .got.loc to match changes in any
literal table section.
(xtensa_is_property_section): Change to match
xtensa_get_property_section_name.
(xtensa_is_littable_section): New.
ld ChangeLog:
2003-07-10 Bob Wilson <bob.wilson@acm.org>
* emulparams/elf32xtensa.sh (OTHER_READONLY_SECTIONS): Replace .xt.lit
with new .got.loc section.
(OTHER_READWRITE_SECTIONS): Do not combine linkonce sections for
non-relocating links.
(OTHER_SECTIONS): Add .xt.lit here. Change it to keep linkonce
sections separate for non-relocating links; likewise for .xt.insn.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bfd-gotloc.diff
Type: text/x-diff
Size: 10358 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20030710/296aadff/attachment.bin>
More information about the Binutils
mailing list