| Summary: | --hash-style=gnu support in ld not detected correctly if ld == gold | ||
|---|---|---|---|
| Product: | uClibc | Reporter: | Bernhard Rosenkraenzer <bero> |
| Component: | Other | Assignee: | unassigned |
| Status: | RESOLVED FIXED | ||
| Severity: | enhancement | CC: | uclibc-cvs |
| Priority: | P5 | ||
| Version: | 0.9.31 | ||
| Target Milestone: | 0.9.32 | ||
| Hardware: | Other | ||
| OS: | Linux | ||
| Host: | Target: | ||
| Build: | |||
| Attachments: | fix | ||
Created attachment 1195 [details]
fix
This patch is not very nice, but fixes the problem
which version of ld are you using? 2.20.51.0.6 -- and it turns out it was using gold by default, ld.bfd does work w/ the original detection method. It could be a ld bug here. Verify if older ld works. armv6j-blankpage-linux-gnueabi <-- How is this uClibc ? Sure looks like a GNU (glibc) built toolchain to me which would make this (INVALID). Nowadays this works at least with gold-1.11 from binutils-2.22 |
When enabling gnu hash support, uClibc's build process errors out with Rules.mak:585: *** Your binutils do not support --hash-style option, while you want to use it. Stop. make: *** [pregen-headers] Error 2 even though binutils does support the --hash-style option. Looking into what happens, Rules.mak runs this command to determine if --hash-style is supported: armv6j-blankpage-linux-gnueabi-ld --hash-style=gnu -o /dev/null -b binary /dev/null This fails, but not because of --hash-style=gnu: armv6j-blankpage-linux-gnueabi-ld: fatal error: /dev/null: mmap failed: Invalid argument strace-ing ld shows: open("/dev/null", O_RDONLY|0x80000) = 3 fstat(3, {st_mode=S_IFCHR|0666, st_rdev=makedev(1, 3), ...}) = 0 mmap(NULL, 0, PROT_READ, MAP_PRIVATE, 3, 0) = -1 EINVAL (Invalid argument) mmap with a size of 0 fails with EINVAL since Linux 2.6.12