[PATCH RFC v2] Add support for non-contiguous memory regions

Christophe Lyon christophe.lyon@linaro.org
Mon Jan 6 15:34:00 GMT 2020


Hi,

This is a follow-up to
https://sourceware.org/ml/binutils/2019-11/msg00402.html

This version detects cases it isn't (yet?) able to handle and emits an
error message (and uses abort() which can probably be made more
user-friendly).

Specifically, I have:
* improved the testcase in ld-elf, hoping that it's now generic enough
(at least it passes on arm and powerpc).

* added a powerpc testcase, based on the sample provided by Simon. It
now fails with an error message when relaxation was applied.

* added several arm testcases, some of which involve farcall stubs
insertion. Something annoying with stubs handling is that I had to
modify arm-specific code to generate an error in a case where the stub
destination could not be allocated. We'd have to do this in every
target that has XXX_build_one_stub().
I now add the SEC_LINKER_CREATED flag on the stubs sections so that we
can emit a helpful error message in case the stubs do not fit in
memory.

There's a new test to check that section order does not change.

Finally, I had to change the way I remove input_section statements in
lang_size_sections_1() to correctly handle the case where we have to
remove the head of the list.

There are now 4 patches, to hopefully make review/comments easier:
* patch1: is the main (code) patch
* patch2: generic test
* patch3: arm tests
* patch4: powerpc test

Thoughts?

Thanks,

Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-Add-arm-tests-for-non-contiguous-memory-regions.patch
Type: text/x-patch
Size: 23092 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20200106/8b246c50/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Add-test-for-non-contiguous-memory-regions.patch
Type: text/x-patch
Size: 4123 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20200106/8b246c50/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0004-Add-powerpc-test-for-non-contiguous-memory-regions.patch
Type: text/x-patch
Size: 2903 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20200106/8b246c50/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Add-support-for-non-contiguous-memory-regions.patch
Type: text/x-patch
Size: 12063 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20200106/8b246c50/attachment-0003.bin>


More information about the Binutils mailing list