[review] jit: enhance test suite

Simon Marchi (Code Review)
2020-02-06T14:22:24Z

Simon Marchi has posted comments on this change.

Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/757
......................................................................

Patch Set 1:

> Patch Set 1:
>
> > Patch Set 1:
> > What about this: the -Ttext-segment=org linker option allows us to define the base of the text segment of the generated binary. We could use that to generate a binary whose text is specifically made to live at a certain address (say, 0x800000), and the generated DWARF information will automatically be generated based on that address.
>
> I like this a lot and from a quick experiment it does seem to work as desired.
>
> One clarification about existing jit.exp tests though - they currently try to load the same library multiple times in a loop and register it as different jit instances. If dynamic binary patching is replaced with -Ttext-segment approach, it won't work anymore. I am currently planning to change it to compile separate binaries each with own fixed base address. Is that OK?

Yeah, I think it would make sense.

--
Gerrit-Project: binutils-gdb
Gerrit-Branch: master
Gerrit-Change-Id: I5f9d56e8eaaa7cf88881eda6a92a72962dd3f066
Gerrit-Change-Number: 757
Gerrit-PatchSet: 1
Gerrit-Owner: Mihails Strasuns <mihails.strasuns@intel.com>
Gerrit-Reviewer: Mihails Strasuns <mihails.strasuns@intel.com>
Gerrit-Reviewer: Simon Marchi <simon.marchi@polymtl.ca>
Gerrit-Comment-Date: Thu, 06 Feb 2020 14:22:15 +0000