[ARM-FDPIC 00/12] FDPIC ABI for ARM
Christophe Lyon
christophe.lyon@linaro.org
Tue Mar 27 08:47:00 GMT 2018
On 26 March 2018 at 22:36, Christophe Lyon <christophe.lyon@linaro.org> wrote:
> On 26 March 2018 at 14:33, Christophe Lyon <christophe.lyon@st.com> wrote:
>> Hi Nick,
>>
>> On 23/03/2018 16:08, Nick Clifton wrote:
>>>
>>> Hi Christophe,
>>>
>>> As a first pass over this patch set, I applied them to the sources
>>> and ran my regression tests. Unfortunately there were several new
>>> failures:
>>>
>>
>> Thanks for your interest in this patch series.
>>
>>> Checking Binutils in: arm-none-eabi ... LD: 6 done
>>> LD REGRESSION: FDPIC ARM shared library little
>>> LD REGRESSION: FDPIC ARM dynamic executable little
>>> LD REGRESSION: FDPIC ARM shared library big
>>> LD REGRESSION: FDPIC ARM dynamic executable big
>>> LD REGRESSION: FDPIC ARM shared library little endian M profile
>>> LD REGRESSION: FDPIC ARM dynamic executable little endian M profile
>>> Checking Binutils in: armeb-eabi ... LD: 6 done
>>> LD REGRESSION: FDPIC ARM shared library little
>>> LD REGRESSION: FDPIC ARM dynamic executable little
>>> LD REGRESSION: FDPIC ARM shared library big
>>> LD REGRESSION: FDPIC ARM dynamic executable big
>>> LD REGRESSION: FDPIC ARM shared library little endian M profile
>>> LD REGRESSION: FDPIC ARM dynamic executable little endian M profile
>>>
>>> It seems that these tests are all failing for the same reason:
>>>
>>> ld-new: unrecognised emulation mode: armelf_linux_fdpiceabi
>>>
>>>
>>> Checking Binutils in: arm-netbsdelf ... GAS: 1 LD: 2 done
>>> GAS REGRESSION: FDPIC relocations
>>> Checking Binutils in: arm-nto ... GAS: 1 done
>>> GAS REGRESSION: FDPIC relocations
>>>
>>> Meanwhile these tests fail for a similar, but not quite the same reason:
>>>
>>> Fatal error: selected target format 'elf32-littlearm-fdpic' unknown
>>>
>>> Would you mind fixing these up please ?
>>>
>
> Hi Nick,
>
> The attached patch avoids running the new tests on unsupported targets.
>
Of course, the first two chunks are not part of what I meant to send.
Cleaned-up patch attached.
Christophe
> Thanks,
>
> Christophe
>
>>
>> I'm looking at it. All these failures are caused by the tests added by this
>> series.
>>
>> I did test them on arm-linux-gnueabihf, armeb-linux-gnueabihf
>> and-linux-uclibceabi,
>> but overlooked testing on arm-eabi and others. As usual, not tested means it
>> does not work :(
>>
>> My homework on de-hardcoding things is obviously not complete :)
>>
>>
>> The simple route would probably be just to skip the tests on those targets,
>> but I have been trying to do something better, but didn't succeed so far.
>>
>> Currently, gas sets the OSABI flag to ELFOSABI_ARM_FDPIC if the user
>> supplied -fdpic. I think this flag should set the linker in the right
>> mode (fdpic/no-fdpic).
>>
>> It seems I have to set arm_elf32_fdpic_le_vec as default (targ_defvec in
>> config.bfd),
>> such that the linker uses that in priority (otherwise arm_elf32_le_vec also
>> accepts to read an FDPIC object file, but fails to flag it as "FDPIC"
>> (because
>> elf-object_p is happy with ELFOSABI_NONE).
>>
>> However, if I do that, the linker then defaults to generating FDPIC files,
>> and thus breaks arm-linux-gnueabihf, unless I force -m armelf_linux_eabi.
>>
>> I have looked at other targets, for instance sh adds -m shelf_fd for its
>> fdpic tests.
>> That's what the patches I have posted do. Is this the only way?
>>
>> How can I have ld support both models transparently without needing to use
>> -m ?
>>
>> Thanks,
>>
>> Christophe
>>
>>
>>> Cheers
>>> Nick
>>> .
>>>
>>
-------------- next part --------------
diff --git a/gas/testsuite/gas/arm/reloc-fdpic.d b/gas/testsuite/gas/arm/reloc-fdpic.d
index 768c3a1..bedb2ff 100644
--- a/gas/testsuite/gas/arm/reloc-fdpic.d
+++ b/gas/testsuite/gas/arm/reloc-fdpic.d
@@ -2,7 +2,7 @@
#objdump: -dr --show-raw-insn
#name: FDPIC relocations
# This test is only valid on ELF based ports.
-#not-target: *-*-*coff *-*-pe *-*-wince *-*-*aout* *-*-netbsd *-*-riscix*
+#not-skip: *-*-uclibceabi
.*: +file format .*arm.*
diff --git a/ld/testsuite/ld-arm/arm-elf.exp b/ld/testsuite/ld-arm/arm-elf.exp
index 00960db..230728e 100644
--- a/ld/testsuite/ld-arm/arm-elf.exp
+++ b/ld/testsuite/ld-arm/arm-elf.exp
@@ -1016,7 +1016,9 @@ set armeabitests_nonacl {
"" {preempt-app.s}
{{readelf -Ds preempt-app.sym}}
"preempt-app"}
+}
+set armfdpiceabitests {
{"FDPIC ARM shared library little endian"
"-shared -T fdpic-shared.ld --hash-style=sysv -EL -m armelf_linux_fdpiceabi" ""
"-EL -fdpic" {fdpic-shared.s}
@@ -1081,6 +1083,10 @@ if { !$is_nacl } {
run_ld_link_tests $armeabitests_nonacl
}
+if { [istarget "arm*-linux-uclibceaci"] } {
+ run_ld_link_tests $armfdpiceabitests
+}
+
run_dump_test "attr-merge-div-00"
run_dump_test "attr-merge-div-01"
run_dump_test "attr-merge-div-10"
More information about the Binutils
mailing list