This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] PR gold/17640


>> Scan::local is called from gold::scan_relocs, so passing view into it
>> will require changes in other targets, which I'd like to avoid.
>> Also I'm not sure how to get view into instruction that uses
>> corresponding relocation.
>
> Gold will fail some TLS testcases in ld, like the ones in
>
> https://sourceware.org/ml/binutils/2007-08/msg00353.html
>
> Target_i386::optimize_tls_reloc should check TLS instruction sequence,
> similar to elf_i386_check_tls_transition.  To do that, you need view.  You
> can add it and update other targets.

We've tried very hard to avoid having to read the actual section data
while scanning relocations; ideally, everything we need to know should
be available from the relocation and the symbol it points to.
(Checking the instruction stream, as we've seen recently, can be
problematic, especially for x86.) In less-than-ideal situations like
this one, if you really must access the contents of the section being
relocated, you should be able to call
obj->section_contents(data_shndx) to get a view for the data. While
running a Scan_relocs task on an object file, the file is locked, and
the view will be released when the file is unlocked at the end of that
task. I'd prefer that you do this only when necessary in the
target-specific code, rather than refactor the world.

(By the way, when posting a patch, please edit out the diffs for
generated files like Makefile.in.)

-cary


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]