Re: [AArch64][2/2] Implement -fpic for -mcmodel=small

2015-06-29 Thread Christophe Lyon
On 27 June 2015 at 14:49, Jiong Wang jiong.w...@arm.com wrote:

 Andreas Schwab writes:

 Jiong Wang jiong.w...@arm.com writes:

 Andreas Schwab writes:

 spawn -ignore SIGHUP /opt/gcc/gcc-20150627/Build/gcc/xgcc 
 -B/opt/gcc/gcc-20150627/Build/gcc/ -fno-diagnostics-show-caret 
 -fdiagnostics-color=never -O0 -w -fpie -c -o pr65593.o 
 /opt/gcc/gcc-20150627/gcc/testsuite/gcc.c-torture/compile/pr65593.c
 /tmp/cc0Pymaf.s: Assembler messages:
 /tmp/cc0Pymaf.s:11: Error: unknown relocation modifier at operand 2 -- 
 `ldr x0,[x0,#:gotpage_lo15:a]'
 /tmp/cc0Pymaf.s:19: Error: unknown relocation modifier at operand 2 --
 `ldr x2,[x0,#:gotpage_lo15:bar]'

 Andreas,

   The binutils patch has been upstreamed already. Please checkout the
   latest binutils code.

 That must work with the current binutils.

 I see, agree.

 Will adopt current ILP32 feature detection mechanism into -fpic.

 And some new TLS patches may need similiar check also.

 Thanks.

Hi Jiong,

I'm not sure I fully understand your answer. I believe you are going
to change the testcase, right?

I'm seeing whole toolchain build failures (when building glibc) since
you committed this, because of the new relocations. I understand your
suggestion is to move to trunk binutils to have support for these new
relocations. Any other things I could do to avoid changing the
binutils version I use?

Thanks
Christophe.


 --
 Regards,
 Jiong



Re: [AArch64][2/2] Implement -fpic for -mcmodel=small

2015-06-29 Thread Jiong Wang

Christophe Lyon writes:

 On 27 June 2015 at 14:49, Jiong Wang jiong.w...@arm.com wrote:

 Andreas Schwab writes:

 Jiong Wang jiong.w...@arm.com writes:

 Andreas Schwab writes:

 spawn -ignore SIGHUP /opt/gcc/gcc-20150627/Build/gcc/xgcc 
 -B/opt/gcc/gcc-20150627/Build/gcc/ -fno-diagnostics-show-caret 
 -fdiagnostics-color=never -O0 -w -fpie -c -o pr65593.o 
 /opt/gcc/gcc-20150627/gcc/testsuite/gcc.c-torture/compile/pr65593.c
 /tmp/cc0Pymaf.s: Assembler messages:
 /tmp/cc0Pymaf.s:11: Error: unknown relocation modifier at operand 2 -- 
 `ldr x0,[x0,#:gotpage_lo15:a]'
 /tmp/cc0Pymaf.s:19: Error: unknown relocation modifier at operand 2 --
 `ldr x2,[x0,#:gotpage_lo15:bar]'

 Andreas,

   The binutils patch has been upstreamed already. Please checkout the
   latest binutils code.

 That must work with the current binutils.

 I see, agree.

 Will adopt current ILP32 feature detection mechanism into -fpic.

 And some new TLS patches may need similiar check also.

 Thanks.

 Hi Jiong,

 I'm not sure I fully understand your answer. I believe you are going
 to change the testcase, right?

Sorry about the trouble.

I am going to add gcc_GAS_CHECK_FEATURE to detect whether those relocs
needed by -fpic supported. Just like what's done for ILP32 detection.

commit 891f2090d994d420cb56942e486f6bba3ede265f
Author: clyon clyon@138bc75d-0d04-0410-961f-82ee72b054a4
Date:   Wed Dec 11 12:57:08 2013 +



 I'm seeing whole toolchain build failures (when building glibc) since
 you committed this, because of the new relocations. I understand your
 suggestion is to move to trunk binutils to have support for these new
 relocations. Any other things I could do to avoid changing the
 binutils version I use?

 Thanks
 Christophe.


 --
 Regards,
 Jiong


-- 
Regards,
Jiong



Re: [AArch64][2/2] Implement -fpic for -mcmodel=small

2015-06-27 Thread Andreas Schwab
spawn -ignore SIGHUP /opt/gcc/gcc-20150627/Build/gcc/xgcc 
-B/opt/gcc/gcc-20150627/Build/gcc/ -fno-diagnostics-show-caret 
-fdiagnostics-color=never -O0 -w -fpie -c -o pr65593.o 
/opt/gcc/gcc-20150627/gcc/testsuite/gcc.c-torture/compile/pr65593.c
/tmp/cc0Pymaf.s: Assembler messages:
/tmp/cc0Pymaf.s:11: Error: unknown relocation modifier at operand 2 -- `ldr 
x0,[x0,#:gotpage_lo15:a]'
/tmp/cc0Pymaf.s:19: Error: unknown relocation modifier at operand 2 -- `ldr 
x2,[x0,#:gotpage_lo15:bar]'
compiler exited with status 1

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
And now for something completely different.


Re: [AArch64][2/2] Implement -fpic for -mcmodel=small

2015-06-27 Thread Jiong Wang

Andreas Schwab writes:

 Jiong Wang jiong.w...@arm.com writes:

 Andreas Schwab writes:

 spawn -ignore SIGHUP /opt/gcc/gcc-20150627/Build/gcc/xgcc 
 -B/opt/gcc/gcc-20150627/Build/gcc/ -fno-diagnostics-show-caret 
 -fdiagnostics-color=never -O0 -w -fpie -c -o pr65593.o 
 /opt/gcc/gcc-20150627/gcc/testsuite/gcc.c-torture/compile/pr65593.c
 /tmp/cc0Pymaf.s: Assembler messages:
 /tmp/cc0Pymaf.s:11: Error: unknown relocation modifier at operand 2 -- `ldr 
 x0,[x0,#:gotpage_lo15:a]'
 /tmp/cc0Pymaf.s:19: Error: unknown relocation modifier at operand 2 --
 `ldr x2,[x0,#:gotpage_lo15:bar]'

 Andreas,

   The binutils patch has been upstreamed already. Please checkout the
   latest binutils code.

 That must work with the current binutils.

I see, agree.

Will adopt current ILP32 feature detection mechanism into -fpic.

And some new TLS patches may need similiar check also.

Thanks.

-- 
Regards,
Jiong



Re: [AArch64][2/2] Implement -fpic for -mcmodel=small

2015-06-27 Thread Jiong Wang

Andreas Schwab writes:

 spawn -ignore SIGHUP /opt/gcc/gcc-20150627/Build/gcc/xgcc 
 -B/opt/gcc/gcc-20150627/Build/gcc/ -fno-diagnostics-show-caret 
 -fdiagnostics-color=never -O0 -w -fpie -c -o pr65593.o 
 /opt/gcc/gcc-20150627/gcc/testsuite/gcc.c-torture/compile/pr65593.c
 /tmp/cc0Pymaf.s: Assembler messages:
 /tmp/cc0Pymaf.s:11: Error: unknown relocation modifier at operand 2 -- `ldr 
 x0,[x0,#:gotpage_lo15:a]'
 /tmp/cc0Pymaf.s:19: Error: unknown relocation modifier at operand 2 --
 `ldr x2,[x0,#:gotpage_lo15:bar]'

Andreas,

  The binutils patch has been upstreamed already. Please checkout the
  latest binutils code.

  commit 99ad26cb0d4f9152dbe5ed03b74020cc52d84d94
  Author: Jiong Wang jiong.w...@arm.com
  Date:   Mon Jun 1 10:26:00 2015 +0100

[AArch64] BFD Support BFD_RELOC_AARCH64_LD64_GOTPAGE_LO15

  Thanks.

-- 
Regards,
Jiong



Re: [AArch64][2/2] Implement -fpic for -mcmodel=small

2015-06-27 Thread Andreas Schwab
Jiong Wang jiong.w...@arm.com writes:

 Andreas Schwab writes:

 spawn -ignore SIGHUP /opt/gcc/gcc-20150627/Build/gcc/xgcc 
 -B/opt/gcc/gcc-20150627/Build/gcc/ -fno-diagnostics-show-caret 
 -fdiagnostics-color=never -O0 -w -fpie -c -o pr65593.o 
 /opt/gcc/gcc-20150627/gcc/testsuite/gcc.c-torture/compile/pr65593.c
 /tmp/cc0Pymaf.s: Assembler messages:
 /tmp/cc0Pymaf.s:11: Error: unknown relocation modifier at operand 2 -- `ldr 
 x0,[x0,#:gotpage_lo15:a]'
 /tmp/cc0Pymaf.s:19: Error: unknown relocation modifier at operand 2 --
 `ldr x2,[x0,#:gotpage_lo15:bar]'

 Andreas,

   The binutils patch has been upstreamed already. Please checkout the
   latest binutils code.

That must work with the current binutils.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
And now for something completely different.


Re: [AArch64][2/2] Implement -fpic for -mcmodel=small

2015-06-26 Thread Marcus Shawcroft
On 26 June 2015 at 10:32, Jiong Wang jiong.w...@arm.com wrote:

 This patch respin https://gcc.gnu.org/ml/gcc-patches/2015-05/msg01804.html.

 A new symbol classification SYMBOL_SMALL_GOT_28K added to represent symbol
 which needs go through GOT table and it's under -fpic/-mcmodel-small. the 
 _28K
 suffix can reflect the symbol's attribute better, and by introducing this new
 symbol type, we could avoid checking aarch64_cmodel at some extent
 though still needs the check somewhere.

 All other code logic not changed.

 OK for trunk?

 Thanks.

 2015-06-26  Jiong. Wang  jiong.w...@arm.com

 gcc/
   * config/aarch64/aarch64-protos.h (aarch64_symbol_type): New type
   SYMBOL_SMALL_GOT_28K.
   * config/aarch64/aarch64.md: (ldr_got_small_mode): Support new GOT
   relocation modifiers.
   (unspec): New enum UNSPEC_GOTMALLPIC28K.
   (ldr_got_small_28k_mode): New.
   (ldr_got_small_28k_sidi): New.
   * config/aarch64/iterators.md (got_modifier): New mode iterator.
   * config/aarch64/aarch64-otps.h (aarch64_code_model): New model.
   * config/aarch64/aarch64.c (aarch64_load_symref_appropriately): Support
   SYMBOL_SMALL_GOT_28K.
   (aarch64_rtx_costs): Add costs for new instruction sequences.
   (initialize_aarch64_code_model): Initialize new model.
   (aarch64_classify_symbol): Recognize new model and new symbol 
 classification.
   (aarch64_asm_preferred_eh_data_format): Support new model.
   (aarch64_load_symref_appropriately): Generate new instruction
   sequences for -fpic.
   (TARGET_USE_PSEUDO_PIC_REG): New definition.
   (aarch64_use_pseudo_pic_reg): New function.

 gcc/testsuite/
   * gcc.target/aarch64/pic-small.c: New testcase.


OK, Thanks Jiong.  Could you prepare a NEWS entry for this change?
Cheers
/Marcus