diff mbox

[v6,18/19] arm64:ilp32: change COMPAT_ELF_PLATFORM to report a a subplatform for ILP32

Message ID 1447795019-30176-19-git-send-email-ynorov@caviumnetworks.com (mailing list archive)
State New, archived
Headers show

Commit Message

Yury Norov Nov. 17, 2015, 9:16 p.m. UTC
From: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>

To make life for tools (such as gdb) easier when dealing with ILP32 processes,
we report a proper subarchitecture for ILP32 in the ELF auxiliary vectors.

Reviewed-by: David Daney <ddaney@caviumnetworks.com>

Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Signed-off-by: Christoph Muellner <christoph.muellner@theobroma-systems.com>
Signed-off-by: Yury Norov <ynorov@caviumnetworks.com>
Signed-off-by: Andrew Pinski <Andrew.Pinski@caviumnetworks.com>
---
 arch/arm64/include/asm/elf.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

zhangjian Nov. 18, 2015, 8:11 a.m. UTC | #1
Hi, Yury

On 2015/11/18 5:16, Yury Norov wrote:
> From: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
> 
> To make life for tools (such as gdb) easier when dealing with ILP32 processes,
> we report a proper subarchitecture for ILP32 in the ELF auxiliary vectors.
I saw some ilp32 relative patches in binutils mailing list. Does gdb
fully support ilp32?

Regards

Bamvor
Andrew Pinski Nov. 18, 2015, 11:21 a.m. UTC | #2
> On Nov 18, 2015, at 12:11 AM, Zhangjian (Bamvor) <bamvor.zhangjian@huawei.com> wrote:
> 
> Hi, Yury
> 
>> On 2015/11/18 5:16, Yury Norov wrote:
>> From: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
>> 
>> To make life for tools (such as gdb) easier when dealing with ILP32 processes,
>> we report a proper subarchitecture for ILP32 in the ELF auxiliary vectors.
> I saw some ilp32 relative patches in binutils mailing list. Does gdb
> fully support ilp32?

I have a patch set but I have not tested them with the latest kernel patch set yet. The branch is located in the binutils-gdb git is https://sourceware.org/git/?p=binutils-gdb.git;a=shortlog;h=refs/heads/users/pinskia/gdb-aarch64-ilp32 .
I think it will mostly work except for core support might need to be changed slightly. 

Thanks,
Andrew
> 
> Regards
> 
> Bamvor
>
Yury Norov Nov. 18, 2015, 8:25 p.m. UTC | #3
On Wed, Nov 18, 2015 at 03:21:05AM -0800, pinskia@gmail.com wrote:
> 
> 
> > On Nov 18, 2015, at 12:11 AM, Zhangjian (Bamvor) <bamvor.zhangjian@huawei.com> wrote:
> > 
> > Hi, Yury
> > 
> >> On 2015/11/18 5:16, Yury Norov wrote:
> >> From: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
> >> 
> >> To make life for tools (such as gdb) easier when dealing with ILP32 processes,
> >> we report a proper subarchitecture for ILP32 in the ELF auxiliary vectors.
> > I saw some ilp32 relative patches in binutils mailing list. Does gdb
> > fully support ilp32?
> 
> I have a patch set but I have not tested them with the latest kernel patch set yet. The branch is located in the binutils-gdb git is https://sourceware.org/git/?p=binutils-gdb.git;a=shortlog;h=refs/heads/users/pinskia/gdb-aarch64-ilp32 .
> I think it will mostly work except for core support might need to be changed slightly. 
> 
> Thanks,
> Andrew
> > 

Yes, it works mostly. I can read and modify text/data, set breakpoints
etc.

> > Regards
> > 
> > Bamvor
> >
Philipp Tomsich Nov. 18, 2015, 9:47 p.m. UTC | #4
Yury,

We had implemented gdb-support against the the earlier ILP32 incarnation.
I’ll take a look with the latest patch-set and see whether these still apply.

Best,
Philipp.

> On 18 Nov 2015, at 21:25, Yury Norov <ynorov@caviumnetworks.com> wrote:
> 
> On Wed, Nov 18, 2015 at 03:21:05AM -0800, pinskia@gmail.com wrote:
>> 
>> 
>>> On Nov 18, 2015, at 12:11 AM, Zhangjian (Bamvor) <bamvor.zhangjian@huawei.com> wrote:
>>> 
>>> Hi, Yury
>>> 
>>>> On 2015/11/18 5:16, Yury Norov wrote:
>>>> From: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
>>>> 
>>>> To make life for tools (such as gdb) easier when dealing with ILP32 processes,
>>>> we report a proper subarchitecture for ILP32 in the ELF auxiliary vectors.
>>> I saw some ilp32 relative patches in binutils mailing list. Does gdb
>>> fully support ilp32?
>> 
>> I have a patch set but I have not tested them with the latest kernel patch set yet. The branch is located in the binutils-gdb git is https://sourceware.org/git/?p=binutils-gdb.git;a=shortlog;h=refs/heads/users/pinskia/gdb-aarch64-ilp32 .
>> I think it will mostly work except for core support might need to be changed slightly. 
>> 
>> Thanks,
>> Andrew
>>> 
> 
> Yes, it works mostly. I can read and modify text/data, set breakpoints
> etc.
> 
>>> Regards
>>> 
>>> Bamvor
>>>
diff mbox

Patch

diff --git a/arch/arm64/include/asm/elf.h b/arch/arm64/include/asm/elf.h
index 8f13dac..3e79569 100644
--- a/arch/arm64/include/asm/elf.h
+++ b/arch/arm64/include/asm/elf.h
@@ -163,9 +163,9 @@  extern int arch_setup_additional_pages(struct linux_binprm *bprm,
 #ifdef CONFIG_COMPAT
 
 #ifdef __AARCH64EB__
-#define COMPAT_ELF_PLATFORM		("v8b")
+#define COMPAT_ELF_PLATFORM		(is_ilp32_compat_task() ? "aarch64_be:ilp32" : "v8b")
 #else
-#define COMPAT_ELF_PLATFORM		("v8l")
+#define COMPAT_ELF_PLATFORM		(is_ilp32_compat_task() ? "aarch64:ilp32" : "v8l")
 #endif
 
 #define COMPAT_ELF_ET_DYN_BASE		(2 * TASK_SIZE_32 / 3)