On 23 April 2018 at 13:53, Christophe Lyon <christophe.l...@st.com> wrote: > On 23/04/2018 14:17, Peter Maydell wrote: >> I have a strong dislike for per-target ifdef ladders. Can we instead >> put the target's implementation of elf_is_fdpic() into >> linux-user/$ARCH/target_elf.h >> and also have that header do >> #define TARGET_HAS_ELF_FDPIC >> >> and then in the generic code we can protect the default elf_is_fdpic() >> with #ifndef TARGET_HAS_ELF_FDPIC. >> > > How invasive could that be? > Your proposal is appealing, but target_elf.h is only included by > linux-user/main.c, which does not define elfhdr etc... > All that knowledge is in linux-user/elfload.c, which controls what > include/elf.h defines.
Hmm, I see what you mean. We can't even put the function inside the existing per-target ifdef ladder, because that comes before the include of elf.h halfway down elfload.c. That's a bit of a mess, but it's a mess we shouldn't try to clean up as part of this patchset, so Reviewed-by: Peter Maydell <peter.mayd...@linaro.org> thanks -- PMM