This is the mail archive of the
mailing list for the binutils project.
[GOLD] question about gold handling SPARC style .rela.plt, .rela.plt overlapping
- From: "WANG.Jiong" <wong dot kwongyuan at gmail dot com>
- To: davem at davemloft dot net, iant at google dot com
- Cc: binutils at sourceware dot org
- Date: Tue, 07 Aug 2012 16:24:42 +0800
- Subject: [GOLD] question about gold handling SPARC style .rela.plt, .rela.plt overlapping
Hi David & Ian,
currently, I am porting gold linker for a private target which allow
so, I met exactly the same problem as you have discussed two years ago
I see you have done a fix with the following logic:
1. .rela.dyn, .rela.plt are seperate
2. generate DT_RELA only when there is .rela.dyn, and DT_RELASZ be
the total size of both .rela.dyn and .rela.plt
But, If there is no .rela.dyn, without DT_RELA, it seems dynamic
linker behave incorrectly when ELF_MACHINE_PLTREL_OVERLAP defined
I checked the implementation of _ELF_DYNAMIC_DO_RELOC in glib
# define _ELF_DYNAMIC_DO_RELOC(RELOC, reloc, map, do_lazy,
without DT_REL or DT_RELA, ranges are not initialized properly.
So, should we always generate DT_RELA, DT_RELASZ, DT_RELAENT, and
make DT_RELA, DT_RELASZ exactly the same value as DT_JMPREL, DT_PLTRELSZ ?
that is, for the following condition check in
4344 if (dyn_rel != NULL && dyn_rel->output_section() != NULL)
4346 odyn->add_section_address(use_rel ? elfcpp::DT_REL :
4348 if (plt_rel != NULL
4349 && plt_rel->output_section() != NULL
4350 && dynrel_includes_plt)
should we check dynrel_includes_plt even when dyn_rel == NULL ?
or I have misunderstood something ?
thanks very much