[PATCH] Create a hook in the TargetHandler to find out which atoms need to have dynamic symbol table entry

Shankar Easwaram shankarke at gmail.com
Sat Jan 18 20:12:12 PST 2014


Hi Simon,

This design would eventually be a problem if -Bsymbolic option would be used. 

I think an appropriate place would be to mark an atom to be exported and deal with that in the TargetLayout. 

By the way, I am on the way removing all the functionality in the writer which calls into the target handler. The way the new changes would work is each target will subclass the writer. This is to make sure writers can try to add more functionality or add more atoms as desired and stay within the limits of the output elf writer. 

Thanks

Shankar easwaran

Sent from my iPhone

> On Jan 18, 2014, at 15:54, Simon Atanasyan <simon at atanasyan.com> wrote:
> 
> Hi Bigcheese, ruiu, shankarke,
> 
> **[ELF]** Find out which atoms need to have dynamic symbol table entry using new virtual `TargetHandler::needsDynSymEntry()` method. Move default conditions from `DynamicLibraryWriter<ELFT>::buildDynamicSymbolTable` and `OutputELFWriter<ELFT>::buildDynamicSymbolTable` methods to the `DefaultTargetHandler::needsDynSymEntry()` routine. Delete redundant `DynamicLibraryWriter<ELFT>::buildDynamicSymbolTable` method.
> 
> **[Mips]** If symbol is referenced by an entry in the global part of GOT, it needs to be exported. Override `needsDynSymEntry()` to satisfy this requirement.
> 
> In general, MIPS related modifications can be moved out from this patch. I include them to demonstrate the goal of these changes.
> 
> http://llvm-reviews.chandlerc.com/D2574
> 
> Files:
>  lib/ReaderWriter/ELF/DefaultTargetHandler.h
>  lib/ReaderWriter/ELF/DynamicLibraryWriter.h
>  lib/ReaderWriter/ELF/Mips/MipsSectionChunks.h
>  lib/ReaderWriter/ELF/Mips/MipsTargetHandler.cpp
>  lib/ReaderWriter/ELF/Mips/MipsTargetHandler.h
>  lib/ReaderWriter/ELF/OutputELFWriter.h
>  lib/ReaderWriter/ELF/TargetHandler.h
>  test/elf/Mips/exe-dynsym.test
> <D2574.1.patch>




More information about the llvm-commits mailing list