Skip to content

ARM ELF parser does not recognize EABI attributes #15544

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
llvmbot opened this issue Feb 6, 2013 · 7 comments
Closed

ARM ELF parser does not recognize EABI attributes #15544

llvmbot opened this issue Feb 6, 2013 · 7 comments
Labels
backend:ARM bugzilla Issues migrated from bugzilla

Comments

@llvmbot
Copy link
Member

llvmbot commented Feb 6, 2013

Bugzilla Link 15172
Resolution FIXED
Resolved on Feb 21, 2014 05:20
Version trunk
OS All
Blocks llvm/llvm-bugzilla-archive#18926
Reporter LLVM Bugzilla Contributor
CC @rengolin

Extended Description

With target 'arm-linux-androideabi' or 'arm-none-linux-gnueabi', clang cannot consume the ARM assembly it generates:

$ echo "void a(){}" | clang -x c -S - -o - | clang -x assembler -c - -integrated-as

:2:2: error: unknown directive
.eabi_attribute 6, 2

@rengolin
Copy link
Member

rengolin commented Sep 9, 2013

Example:

test.c:
void main {return;}

commandline:
arm-linux-clang -Iarm-2013.05-24-arm-none-linux/arm-none-linux-gnueabi/libc/usr/include -integrated-as -msoft-float -save-temps -O3 -mcpu=cortex-a8 -c -o test.o test.c

Errors:
ffconf.rmzKnl5U.s:2:2: error: unknown directive
.cpu cortex-a8
^
ffconf.rmzKnl5U.s:3:2: error: unknown directive
.eabi_attribute 6, 10
^

@llvmbot
Copy link
Member Author

llvmbot commented Oct 30, 2013

Since r193524, all LLVM-generated directives can be parsed and assembled.

However, there are still some work to do. The eabi_attribute is not fully implemented. Following list of tags are not recognized:

Tag_CPU_raw_name (NTBS)
Tag_compatibility (ULEB128, NTBS)
Tag_also_compatible_with (ULEB128, ULEB128), (ULEB128, NTBS)
Tag_conformance (STRING)

@llvmbot
Copy link
Member Author

llvmbot commented Nov 27, 2013

Is there any plan to support parsing named eabi_attributes in assembly to match gnu as (https://sourceware.org/binutils/docs/as/ARM-Directives.html)?

For example,
.eabi_attribute Tag_ABI_align_needed, 1

instead of
.eabi_attribute 24, 1

@rengolin
Copy link
Member

Hi David,

Yes, the plan is to support them all, but I don't know if anyone is looking at these particular examples you shown. Certainly, adding them to this bug would be a good help.

Feel free to work on them, too, if you can. ;)

--renato

@llvmbot
Copy link
Member Author

llvmbot commented Nov 27, 2013

Here is the list of attribute tag names support by gnu as that I think we should also support:

Tag_CPU_raw_name, Tag_CPU_name, Tag_CPU_arch, Tag_CPU_arch_profile, Tag_ARM_ISA_use, Tag_THUMB_ISA_use, Tag_FP_arch, Tag_WMMX_arch, Tag_Advanced_SIMD_arch, Tag_PCS_config, Tag_ABI_PCS_R9_use, Tag_ABI_PCS_RW_data, Tag_ABI_PCS_RO_data, Tag_ABI_PCS_GOT_use, Tag_ABI_PCS_wchar_t, Tag_ABI_FP_rounding, Tag_ABI_FP_denormal, Tag_ABI_FP_exceptions, Tag_ABI_FP_user_exceptions, Tag_ABI_FP_number_model, Tag_ABI_align_needed, Tag_ABI_align_preserved, Tag_ABI_enum_size, Tag_ABI_HardFP_use, Tag_ABI_VFP_args, Tag_ABI_WMMX_args, Tag_ABI_optimization_goals, Tag_ABI_FP_optimization_goals, Tag_compatibility, Tag_CPU_unaligned_access, Tag_FP_HP_extension, Tag_ABI_FP_16bit_format, Tag_MPextension_use, Tag_DIV_use, Tag_nodefaults, Tag_also_compatible_with, Tag_conformance, Tag_T2EE_use, Tag_Virtualization_use

This list is taken from the document linked above. It also says,

Note - the following legacy values are also accepted by tag: Tag_VFP_arch, Tag_ABI_align8_needed, Tag_ABI_align8_preserved, Tag_VFP_HP_extension,

I'm not sure if we want to support those as well.

@rengolin
Copy link
Member

rengolin commented Jan 8, 2014

Commit r198662 added all named tags.

@rengolin
Copy link
Member

mentioned in issue llvm/llvm-bugzilla-archive#18926

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 4, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend:ARM bugzilla Issues migrated from bugzilla
Projects
None yet
Development

No branches or pull requests

2 participants