0001-agent-tcf-services-tcf_elf.c-fix-x86-build.patch 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. From 0a847ca035113540ee44d17f364bf4701fe78355 Mon Sep 17 00:00:00 2001
  2. From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  3. Date: Fri, 1 Mar 2024 22:31:05 +0100
  4. Subject: [PATCH] agent/tcf/services/tcf_elf.c: fix x86 build
  5. Fix the following x86 build failure raised since version 1.8.0 and
  6. https://gitlab.eclipse.org/eclipse/tcf/tcf.agent/-/commit/8df5540c53b862d516ac25f908c2fff4a547b4a6:
  7. /home/buildroot/autobuild/run/instance-1/output-1/build/tcf-agent-1.8.0/agent/tcf/services/tcf_elf.c: In function 'unpack_elf_symbol_info':
  8. /home/buildroot/autobuild/run/instance-1/output-1/build/tcf-agent-1.8.0/agent/tcf/services/tcf_elf.c:2079:27: error: 'STT_ARM_16BIT' undeclared (first use in this function)
  9. 2079 | if (info->type == STT_ARM_16BIT) {
  10. | ^~~~~~~~~~~~~
  11. /home/buildroot/autobuild/run/instance-1/output-1/build/tcf-agent-1.8.0/agent/tcf/services/tcf_elf.c:2079:27: note: each undeclared identifier is reported only once for each function it appears in
  12. /home/buildroot/autobuild/run/instance-1/output-1/build/tcf-agent-1.8.0/agent/tcf/services/tcf_elf.c: In function 'create_symbol_addr_search_index':
  13. /home/buildroot/autobuild/run/instance-1/output-1/build/tcf-agent-1.8.0/agent/tcf/services/tcf_elf.c:2228:78: error: 'STT_ARM_16BIT' undeclared (first use in this function)
  14. 2228 | if (type == STT_FUNC || type == STT_ARM_TFUNC || type == STT_ARM_16BIT) {
  15. | ^~~~~~~~~~~~~
  16. Fixes:
  17. - http://autobuild.buildroot.org/results/8388acf59689ed7e621bdf158483e3df1cf9bef7
  18. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  19. Upstream: https://gitlab.eclipse.org/eclipse/tcf/tcf.agent/-/merge_requests/1
  20. ---
  21. agent/tcf/services/tcf_elf.c | 8 +++++++-
  22. 1 file changed, 7 insertions(+), 1 deletion(-)
  23. diff --git a/agent/tcf/services/tcf_elf.c b/agent/tcf/services/tcf_elf.c
  24. index 1b3900ec..b0b948e4 100644
  25. --- a/agent/tcf/services/tcf_elf.c
  26. +++ b/agent/tcf/services/tcf_elf.c
  27. @@ -2076,10 +2076,12 @@ void unpack_elf_symbol_info(ELF_Section * sym_sec, U4_T index, ELF_SymbolInfo *
  28. }
  29. if (file->machine == EM_ARM) {
  30. +#ifdef STT_ARM_16BIT
  31. if (info->type == STT_ARM_16BIT) {
  32. info->type = STT_OBJECT;
  33. info->type16bit = 1;
  34. }
  35. +#endif
  36. if (info->type == STT_ARM_TFUNC) {
  37. info->type = STT_FUNC;
  38. info->type16bit = 1;
  39. @@ -2225,7 +2227,11 @@ static void create_symbol_addr_search_index(ELF_Section * sec) {
  40. }
  41. add = add && type != STT_GNU_IFUNC;
  42. if (add && file->machine == EM_ARM) {
  43. - if (type == STT_FUNC || type == STT_ARM_TFUNC || type == STT_ARM_16BIT) {
  44. + if (type == STT_FUNC || type == STT_ARM_TFUNC
  45. +#ifdef STT_ARM_16BIT
  46. + || type == STT_ARM_16BIT
  47. +#endif
  48. + ) {
  49. addr = addr & ~(U8_T)1;
  50. }
  51. }
  52. --
  53. 2.43.0